launch name trade: Check for getstarg() failure immediately

Rather than after post-yield sanity checking.  Just to make it obvious
that we are handling getstarg() failure.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2015-01-09 16:25:34 +01:00
parent 57fd96a7cf
commit 4ec6df865b
3 changed files with 10 additions and 12 deletions

View file

@ -52,10 +52,10 @@ name(void)
if (!player->owner)
continue;
p = getstarg(player->argp[2], "Name? ", buf);
if (!check_ship_ok(&ship))
return RET_FAIL;
if (!p || !*p)
return RET_SYN;
if (!check_ship_ok(&ship))
return RET_FAIL;
if (!strcmp(p, "~")) {
ship.shp_name[0] = 0;
} else {