From 0b14f387d439c5c1e29133e28ee3da4ab868757a Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 20 Nov 2012 18:55:44 +0100 Subject: [PATCH] fix error handling in ncurses resize code --- src/ncurses.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ncurses.cc b/src/ncurses.cc index 5c5509fb..c2bd4812 100644 --- a/src/ncurses.cc +++ b/src/ncurses.cc @@ -80,7 +80,7 @@ void on_term_resize(int) { int fd = open("/dev/tty", O_RDWR); winsize ws; - if (fd == 0 or ioctl(fd, TIOCGWINSZ, (void*)&ws) != 0) + if (fd == -1 or ioctl(fd, TIOCGWINSZ, (void*)&ws) != 0) return; close(fd); resizeterm(ws.ws_row, ws.ws_col);