summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux2012-03-11 23:54:14 +0100
committerQuentin Carbonneaux2012-03-11 23:54:14 +0100
commit110c0a8075a87cf1991233c158ad51fe69e48e2a (patch)
tree216aeda85b3753cbb7268e4be7eeda8e39f0f705
parent7242e2cc4b68ca55086a26cb57139a9b29470bbf (diff)
Test the result of ioctl (TIOCGWINSZ).
-rw-r--r--irc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/irc.c b/irc.c
index 05cd711..9e5f1af 100644
--- a/irc.c
+++ b/irc.c
@@ -351,7 +351,8 @@ tresize(void)
struct winsize ws;
winchg=0;
- ioctl(0, TIOCGWINSZ, &ws);
+ if (ioctl(0, TIOCGWINSZ, &ws)<0)
+ panic("Ioctl (TIOCGWINSZ) failed.");
resizeterm(scr.y=ws.ws_row, scr.x=ws.ws_col);
if (scr.y<3 || scr.x<10)
panic("Screen too small.");