retreat lretreat: Fix crash when getstarg() fails
Broken in commit 40ec33b
. Mitigating factor: can only happen when the
player gives an empty argument, e.g. retreat 0 "".
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
beedf8dced
commit
b72f727b9b
1 changed files with 2 additions and 0 deletions
|
@ -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]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue