From a0db2c2d8131162d4df09a81d6c61cb7fc836a04 Mon Sep 17 00:00:00 2001 From: Steve Slaven Date: Thu, 2 Feb 2006 21:34:46 +0000 Subject: Fixes crash if non-latin-1 character is entered before connecting to a server (Dain) diff --git a/main.c b/main.c index ca4d2cf..5353873 100644 --- a/main.c +++ b/main.c @@ -1316,7 +1316,10 @@ static void get_user_input __P0 (void) while ((j = tty_read(c, chunk)) < 0 && errno == EINTR) ; - if (j <= 0 || (chunk == 1 && j != chunk)) + if (j == 0) + return; + + if (j < 0 || (chunk == 1 && j != chunk)) syserr("read from tty"); c[chunk] = '\0'; -- cgit v0.10.2