From 911a3756c6dba95d7b6039f1a740ff278b269943 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 27 Mar 2015 15:29:54 +0200 Subject: [PATCH] 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. --- win/tty/wintty.c | 1 + 1 file changed, 1 insertion(+) 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)