Clean up unreadable assignments within if conditionals

Pinpointed assignments within if conditionals with spatch -sp_file
tests/bad_assign.cocci (from coccinelle-0.1.4).  Cherry-picked diff
hunks affecting conditionals split over multiple lines, and cleaned
them up.
This commit is contained in:
Markus Armbruster 2009-03-21 09:24:45 +01:00
parent 7c6e56bd02
commit 57717b5bc1
15 changed files with 75 additions and 75 deletions

View file

@ -46,9 +46,8 @@ chan(void)
char buf[1024];
struct natstr *us;
if ((p =
getstarg(player->argp[1], "country name or representative? ",
buf)) == 0)
p = getstarg(player->argp[1], "country name or representative? ", buf);
if (p == 0)
return RET_SYN;
us = getnatp(player->cnum);
if (us->nat_stat == STAT_VIS) {
@ -76,8 +75,8 @@ chan(void)
charge = us->nat_money / 10;
}
}
if ((p =
getstarg(player->argp[2], "New country name -- ", buf)) == 0)
p = getstarg(player->argp[2], "New country name -- ", buf);
if (p == 0)
return RET_SYN;
if (!check_nat_name(p))
return RET_FAIL;
@ -90,8 +89,8 @@ chan(void)
case 'p':
case 'r':
pr("(note: these are stored in plain text.)\n");
if ((p = getstarg(player->argp[2],
"New representative name -- ", buf)) == 0)
p = getstarg(player->argp[2], "New representative name -- ", buf);
if (p == 0)
return RET_SYN;
p[sizeof(us->nat_pnam) - 1] = 0;
strcpy(us->nat_pnam, p);