From: Pasi Kallinen Date: Fri, 27 Mar 2015 13:29:54 +0000 (+0200) Subject: TTY: Guard against impossible x coord X-Git-Tag: NetHack-3.6.0_RC01~545 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=911a3756c6dba95d7b6039f1a740ff278b269943;p=nethack TTY: Guard against impossible x coord If a menu item was longer than terminal width, the menu wasn't cleared away after it was finished with. This easily happened when an inventory item was named. --- diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 553553744..f3cc97eb5 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1809,6 +1809,7 @@ tty_display_nhwindow(window, blocking) cw->offx = (uchar) (int) max((int) 10, (int) (ttyDisplay->cols - cw->maxcol - 1)); #endif + if(cw->offx < 0) cw->offx = 0; if(cw->type == NHW_MENU) cw->offy = 0; if(ttyDisplay->toplin == 1)