Exit on zero read
parent
fc5bf09c46
commit
c6cd59f5c8
5
chat.c
5
chat.c
|
@ -460,6 +460,11 @@ static void clientRead(void) {
|
|||
|
||||
ssize_t size = tls_read(client.tls, buf + fill, sizeof(buf) - fill);
|
||||
if (size < 0) errx(EX_IOERR, "tls_read: %s", tls_error(client.tls));
|
||||
if (!size) {
|
||||
// FIXME: Always endwin
|
||||
endwin();
|
||||
exit(EX_OK);
|
||||
}
|
||||
fill += size;
|
||||
|
||||
char *end, *line = buf;
|
||||
|
|
Loading…
Reference in New Issue