Curses: Fix accessing illegal window id
This commit is contained in:
@@ -645,7 +645,6 @@ curses_puts(winid wid, int attr, const char *text)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
curses_set_wid_colors(wid, NULL);
|
|
||||||
if (curses_is_menu(wid) || curses_is_text(wid)) {
|
if (curses_is_menu(wid) || curses_is_text(wid)) {
|
||||||
if (!curses_menu_exists(wid)) {
|
if (!curses_menu_exists(wid)) {
|
||||||
impossible(
|
impossible(
|
||||||
@@ -657,6 +656,7 @@ curses_puts(winid wid, int attr, const char *text)
|
|||||||
curses_add_nhmenu_item(wid, &nul_glyphinfo, &Id, 0, 0,
|
curses_add_nhmenu_item(wid, &nul_glyphinfo, &Id, 0, 0,
|
||||||
attr, NO_COLOR, text, MENU_ITEMFLAGS_NONE);
|
attr, NO_COLOR, text, MENU_ITEMFLAGS_NONE);
|
||||||
} else {
|
} else {
|
||||||
|
curses_set_wid_colors(wid, NULL);
|
||||||
waddstr(win, text);
|
waddstr(win, text);
|
||||||
wnoutrefresh(win);
|
wnoutrefresh(win);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user