]> git.pond.sub.org Git - empserver/commitdiff
(edit): Crashed when country argument didn't name a country. Fix &
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 22 May 2006 18:51:24 +0000 (18:51 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 22 May 2006 18:51:24 +0000 (18:51 +0000)
simplify.  Reported by Pat Loney.

src/lib/commands/edit.c

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