Avoid cryptic message when survey's first argument is empty

Catch empty argument instead of letting nstr_comp_val() choke on it.
This commit is contained in:
Markus Armbruster 2008-07-19 11:47:06 -04:00
parent 4646dfbf80
commit 05364c0f68

View file

@ -66,7 +66,7 @@ surv(void)
nsect = 0;
ptr = getstarg(player->argp[1], "commodity or variable? ", buf);
if (ptr == 0)
if (!ptr || !*ptr)
return RET_SYN;
ptr = nstr_comp_val(ptr, &val, EF_SECTOR);
if (!ptr)