Exit on zero read

master
Curtis McEnroe 2018-08-04 01:38:43 -04:00
parent fc5bf09c46
commit c6cd59f5c8
No known key found for this signature in database
GPG Key ID: CEA2F97ADCFCD77C
1 changed files with 5 additions and 0 deletions

5
chat.c
View File

@ -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;