fix #H7140 - list MSGTYPE values shows empty strings

The 'O' menu's 'list' for MSGTYPE settings showed truncated versions
of really long message strings but didn't show anything except the
hide/stop/norep setting for ordinary length ones.  3.6.0 showed the
latter correctly but suffered buffer overflow for the former; the
fix for that had a typo/thinko in it.
This commit is contained in:
PatR
2018-05-12 01:05:29 -07:00
parent 2dbb7c70c9
commit 39057ec754

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 options.c $NHDT-Date: 1510963525 2017/11/18 00:05:25 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.319 $ */
/* NetHack 3.6 options.c $NHDT-Date: 1526112322 2018/05/12 08:05:22 $ $NHDT-Branch: master $:$NHDT-Revision: 1.323 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2008. */
/* NetHack may be freely redistributed. See license for details. */
@@ -4821,7 +4821,7 @@ boolean setinitial, setfromfile;
if (strlen(tmp->pattern) > ln)
Strcat(strncat(mtbuf, tmp->pattern, ln - 3), "...\"");
else
Strcat(mtbuf, "\"");
Strcat(strcat(mtbuf, tmp->pattern), "\"");
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, mtbuf,
MENU_UNSELECTED);
tmp = tmp->next;