From c6cd59f5c8dd9a0853d8603224a5b55d374c9f11 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Sat, 4 Aug 2018 01:38:43 -0400 Subject: Exit on zero read --- chat.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'chat.c') diff --git a/chat.c b/chat.c index 20a4290..239e390 100644 --- a/chat.c +++ b/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; -- cgit 1.4.1-2-gfad0