Fix segfault in curses

Curses handles menu and text windows specially; their id numbers
keep going up, so we need to check if the id is for a menu or
text window instead of directly accessing the windows array.
This commit is contained in:
Pasi Kallinen
2024-03-17 20:09:38 +02:00
parent 4030ef13a0
commit 0700f60983

View File

@@ -572,6 +572,10 @@ curses_get_window_size(winid wid, int *height, int *width)
boolean
curses_window_has_border(winid wid)
{
if (curses_is_menu(wid))
wid = MENU_WIN;
else if (curses_is_text(wid))
wid = TEXT_WIN;
return nhwins[wid].border;
}