From: PatR Date: Mon, 20 Apr 2020 20:28:43 +0000 (-0700) Subject: fix wishing crash X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=63b1bf54e821242dfd5ad89fbe7420d0a43d640e;p=nethack fix wishing crash After 05403182ebc542da4bacd716cef408a27372c1ad (I think, possibly the change to objnam.c which followed that one) from a couple of days ago, wishing for a monster name dereferenced a Null pointer and crashed. --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 102e6fb53..81979ff62 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -197,6 +197,9 @@ teleport feedback "you materialize at another location" was given too soon moving around underwater poison gas clouds located over known but unlit pools were visible as known clouds but steam clouds in that situation were not +after the wish parsing change, wishing for "" or for + "" worked as intended but wishing for "" + (where used the canonical spelling) triggered a crash tty: redraw unexplored locations as S_unexplored rather than after map has been partially overwritten by popup menu or text display tty: previous change resulted in remnants of previous level being shown on diff --git a/src/mondata.c b/src/mondata.c index c29317550..4e0ba2d0a 100644 --- a/src/mondata.c +++ b/src/mondata.c @@ -829,6 +829,7 @@ const char **remainder_p; if (m_i_len > len && !strncmpi(mons[i].mname, str, m_i_len)) { if (m_i_len == slen) { mntmp = i; + len = m_i_len; break; /* exact match */ } else if (slen > m_i_len && (str[m_i_len] == ' '