prevent a couple of reported array index segfaults

Changes to be committed:
	modified:   src/hack.c
	modified:   src/pager.c

Don't use glyph_to_cmap as an array index into
the defsyms[] array unless it really is a cmap.

Recent situation: glyph_to_cmap will return
NO_GLYPH for the unknown monster glyph 'I', which
is not a valid index for the defsyms[] array.
This commit is contained in:
nhmall
2015-04-18 15:29:37 -04:00
parent 323b7bba2c
commit 78b012a680
2 changed files with 3 additions and 2 deletions

View File

@@ -1363,7 +1363,7 @@ domove()
if (boulder)
Strcpy(buf, ansimpleoname(boulder));
else if (solid)
else if (solid && glyph_is_cmap(glyph))
Strcpy(buf, the(defsyms[glyph_to_cmap(glyph)].explanation));
else if (!Underwater)
Strcpy(buf, "thin air");