Don't use 0 as null pointer constant, part 3

This part replaces E == 0 by !E, where E has pointer type.
This commit is contained in:
Markus Armbruster 2009-03-23 22:58:54 +01:00
parent 90f8f2b099
commit 6ae4eca045
79 changed files with 121 additions and 121 deletions

View file

@ -102,7 +102,7 @@ do_treaty(void)
theircond = 0;
for (tfp = treaty_flags; tfp && tfp->name; tfp++) {
sprintf(prompt, "%s? ", tfp->name);
if ((cp = getstring(prompt, buf)) == 0)
if (!(cp = getstring(prompt, buf)))
return RET_FAIL;
if (*cp == 'y')
theircond |= tfp->value;
@ -111,7 +111,7 @@ do_treaty(void)
ourcond = 0;
for (tfp = treaty_flags; tfp && tfp->name; tfp++) {
sprintf(prompt, "%s? ", tfp->name);
if ((cp = getstring(prompt, buf)) == 0)
if (!(cp = getstring(prompt, buf)))
return RET_FAIL;
if (*cp == 'y')
ourcond |= tfp->value;
@ -121,7 +121,7 @@ do_treaty(void)
return RET_SYN;
}
cp = getstring("Proposed treaty duration? (days) ", buf);
if (cp == 0)
if (!cp)
return RET_FAIL;
j = atoi(cp);
if (j <= 0) {