Simplify getpath()
This commit is contained in:
parent
052d514bfe
commit
0b0612ea04
1 changed files with 3 additions and 3 deletions
|
@ -169,13 +169,13 @@ getpath(char *buf, char *arg, coord x, coord y, int onlyown,
|
||||||
xyas(x, y, player->cnum));
|
xyas(x, y, player->cnum));
|
||||||
}
|
}
|
||||||
bp = getstring(prompt, buf2);
|
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("Path length may not exceed %d.\n", MAX_PATH_LEN);
|
||||||
pr("Aborting...\n");
|
pr("Aborting...\n");
|
||||||
bp = NULL;
|
bp = NULL;
|
||||||
}
|
}
|
||||||
if (!bp)
|
|
||||||
return NULL;
|
|
||||||
strcpy(p, bp);
|
strcpy(p, bp);
|
||||||
if (*bp)
|
if (*bp)
|
||||||
goto more;
|
goto more;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue