about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-01-24 20:43:30 -0800
committerKartik K. Agaram <vc@akkartik.com>2022-01-24 20:43:30 -0800
commit6d53235dfcfb5cb3008d3b16c021a3b24b59112a (patch)
tree0b8d1f698ec3606206a783154a0a5f1ab0837f0d /src
parent6a33284b0745880a5e9bf7c78dfb6cadc8bbf28b (diff)
downloadteliva-6d53235dfcfb5cb3008d3b16c021a3b24b59112a.tar.gz
work around a bug in NetBSD libcurses
http://gnats.netbsd.org/56664 reported.
Diffstat (limited to 'src')
-rw-r--r--src/lcurses/window.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lcurses/window.c b/src/lcurses/window.c
index 2f80390..2ce418d 100644
--- a/src/lcurses/window.c
+++ b/src/lcurses/window.c
@@ -1302,6 +1302,7 @@ Wgetch(lua_State *L)
 	render_trusted_teliva_data(L);  /* Apps can draw what they want on screen,
 	                                 * but Teliva's UI is always visible when
 	                                 * asking the user to make a decision. */
+	if (x > COLS-2) x = COLS-2; if (y > LINES-1) y = LINES-1; /* http://gnats.netbsd.org/56664 */
 	mvaddstr(y, x, "");
 	int c = wgetch(w);