From f71d3954f02ccd9c7703acb383ac7ab54108e6b6 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Sat, 18 Nov 2023 20:22:04 +0100 Subject: [PATCH] checked getline return value in client main i hope these comints are sort of intelligent cause im drunk as hell :dd --- src/chat/main/client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/chat/main/client.c b/src/chat/main/client.c index 768c98f..eef8bb0 100644 --- a/src/chat/main/client.c +++ b/src/chat/main/client.c @@ -66,7 +66,8 @@ int main(void) for (;;) { - getline(&line, &line_length, stdin); + if (getline(&line, &line_length, stdin) == -1) why2_die("Reading input failed."); + printf(WHY2_CLEAR_AND_GO_UP); why2_send_socket(line, "anon", listen_socket);