]> git.pond.sub.org Git - empserver/commitdiff
Avoid cryptic message when survey's first argument is empty
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 19 Jul 2008 15:47:06 +0000 (11:47 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 21 Jul 2008 12:13:40 +0000 (08:13 -0400)
Catch empty argument instead of letting nstr_comp_val() choke on it.

src/lib/commands/surv.c

index d3a27e8dcdba847f9e42335caba2b1dc2a9e4507..92117a7d8846a858c094c8d915f072d947de14d1 100644 (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)