]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/navi.c
Fix navigate/march crash on funny path arguments
[empserver] / src / lib / commands / navi.c
index cf297411e527e02cdfc12cc22fbc120369f289dc..0f6189cdb3124241708d4b2c353e0ba88ecc0c65 100644 (file)
@@ -184,7 +184,10 @@ do_unit_move(struct emp_qelem *ulist, int *together,
            continue;
        }
        ac = parse(cp, scanspace, player->argp, NULL, NULL, NULL);
            continue;
        }
        ac = parse(cp, scanspace, player->argp, NULL, NULL, NULL);
-       if (ac <= 1) {
+       if (ac <= 0) {
+           player->argp[0] = "";
+           cp = NULL;
+       } else if (ac == 1) {
            sprintf(dp, "%d", leader->uid);
            player->argp[1] = dp;
            cp++;
            sprintf(dp, "%d", leader->uid);
            player->argp[1] = dp;
            cp++;