]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/retr.c
retreat lretreat: Fix crash when getstarg() fails
[empserver] / src / lib / commands / retr.c
index 39c14d65194f4c1abe4bd254805d248827129518..326419db33c234e9a02566cfc6f5c1c948f5a6e1 100644 (file)
@@ -87,6 +87,8 @@ retreat(int type)
     nunits = 0;
     if (player->argp[2] != NULL) {
        pq = getstarg(player->argp[2], "Retreat path? ", buf1);
+       if (!pq)
+           return RET_SYN;
        for (i = 0; i < RET_LEN - 1 && pq[i]; i++) {
            if (chkdir(pq[i], DIR_STOP, DIR_LAST) < 0) {
                pr("'%c' is not a valid direction...\n", pq[i]);