]> granicus.if.org Git - nethack/commitdiff
remove redundant condition on tty_add_menu()
authorSHIRAKATA Kentaro <argrath@ub32.org>
Tue, 8 Feb 2022 18:44:04 +0000 (03:44 +0900)
committerPatR <rankin@nethack.org>
Sat, 30 Apr 2022 06:08:17 +0000 (23:08 -0700)
`newstr` is assigned to `str` or `buf`.
`buf` is an address of an array, and `str` is guarded,
so both are non-NULL.

win/tty/wintty.c

index 291af4e502d38a87b65149544d3cfea28f115be5..113cf883fac88223fc951079de5403b74a08de0e 100644 (file)
@@ -3036,7 +3036,7 @@ tty_add_menu(winid window,  /* window to use, must be of type NHW_MENU */
     item->selector = ch;
     item->gselector = gch;
     item->attr = attr;
-    item->str = dupstr(newstr ? newstr : "");
+    item->str = dupstr(newstr);
 
     item->next = cw->mlist;
     cw->mlist = item;