]> git.pond.sub.org Git - empserver/commitdiff
Simplify getpath()
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 19 Jul 2008 19:54:29 +0000 (15:54 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 21 Jul 2008 12:13:40 +0000 (08:13 -0400)
src/lib/subs/paths.c

index 12389167b6d56fe4cc6e8bb30f1832e9e91113f4..e6ce39714c6bbc63a78b0914f5775b5109af9d4e 100644 (file)
@@ -169,13 +169,13 @@ getpath(char *buf, char *arg, coord x, coord y, int onlyown,
                xyas(x, y, player->cnum));
     }
     bp = getstring(prompt, buf2);
-    if (bp && p + strlen(bp) + 1 >= buf + MAX_PATH_LEN) {
+    if (!bp)
+       return NULL;
+    if (p + strlen(bp) + 1 >= buf + MAX_PATH_LEN) {
        pr("Path length may not exceed %d.\n", MAX_PATH_LEN);
        pr("Aborting...\n");
        bp = NULL;
     }
-    if (!bp)
-       return NULL;
     strcpy(p, bp);
     if (*bp)
        goto more;