1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-05-06 07:15:15 +01:00

Bugfix: Bad index in tty window code.

WIN_MESSAGE isn't actually a constant and is changed to WIN_ERR (-1) in end.c, but wins[WIN_MESSAGE] was blindly checked in free_window_info().

Check to make sure WIN_MESSAGE is not WIN_ERR before indexing into wins[].
This commit is contained in:
chris 2024-05-06 14:08:56 -04:00
parent c1eccba419
commit a28f17919a

View file

@ -1028,7 +1028,7 @@ free_window_info(cw, free_data)
int i;
if (cw->data) {
if (cw == wins[WIN_MESSAGE] && cw->rows > cw->maxrow)
if (WIN_MESSAGE != WIN_ERR && cw == wins[WIN_MESSAGE] && cw->rows > cw->maxrow)
cw->maxrow = cw->rows; /* topl data */
for(i=0; i<cw->maxrow; i++)
if(cw->data[i]) {