aboutsummaryrefslogtreecommitdiffstats
path: root/kirc.c
diff options
context:
space:
mode:
Diffstat (limited to 'kirc.c')
-rw-r--r--kirc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kirc.c b/kirc.c
index 7c9857d..5445526 100644
--- a/kirc.c
+++ b/kirc.c
@@ -231,7 +231,10 @@ handle_user_input(void) {
char usrin[MSG_MAX], *tok;
- fgets(usrin, MSG_MAX, stdin);
+ if (fgets(usrin, MSG_MAX, stdin) == NULL) {
+ perror("fgets");
+ exit(1);
+ }
size_t msg_len = strlen(usrin);
if (usrin[msg_len - 1] == '\n') {