(edit): Crashed when country argument didn't name a country. Fix &

simplify.  Reported by Pat Loney.
This commit is contained in:
Markus Armbruster 2006-05-22 18:51:24 +00:00
parent 44a5e5d65a
commit a8e2df3ad8

View file

@ -108,12 +108,9 @@ edit(void)
return RET_FAIL; return RET_FAIL;
break; break;
case 'c': case 'c':
if (!(ptr = getstarg(player->argp[2], "Country number? ", buf))) np = natargp(player->argp[2], "Country? ");
if (!np)
return RET_SYN; return RET_SYN;
if (isdigit(*ptr))
np = getnatp(atoi(ptr));
else
np = natargp(ptr, NULL);
break; break;
case 'p': case 'p':
if ((num = onearg(player->argp[2], "Plane number? ")) < 0) if ((num = onearg(player->argp[2], "Plane number? ")) < 0)