diff --git a/src/chat/main/client.c b/src/chat/main/client.c index a4450e0..9bc8347 100644 --- a/src/chat/main/client.c +++ b/src/chat/main/client.c @@ -51,7 +51,7 @@ int main(void) //GET IP printf("Welcome.\n\nEnter IP Address:\n>>> "); - getline(&line, &line_length, stdin); + if (getline(&line, &line_length, stdin) == -1) why2_die("Reading input failed."); //TODO: Add enums to why2_die() server_addr.sin_addr.s_addr = inet_addr(line); diff --git a/src/chat/main/server.c b/src/chat/main/server.c index 5674b01..d16824d 100644 --- a/src/chat/main/server.c +++ b/src/chat/main/server.c @@ -61,7 +61,7 @@ int main(void) for (;;) { - getline(&line_buffer, &line_length_buffer, stdin); + if (getline(&line_buffer, &line_length_buffer, stdin) == -1) why2_die("Reading input failed."); if (strcmp(line_buffer, "!exit\n") == 0) //USER REQUESTED PROGRAM EXIT {