From 68aded8d7dce36007bc3ba80a35719ac4c89385f Mon Sep 17 00:00:00 2001 From: mcpcpc Date: Sat, 12 Sep 2020 23:04:08 -0400 Subject: add guard around 'if' statement --- kirc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'kirc.c') diff --git a/kirc.c b/kirc.c index da12ffc..8429375 100644 --- a/kirc.c +++ b/kirc.c @@ -182,7 +182,6 @@ handle_server_message(void) { } } if (message_end == MSG_MAX) { - /* The buffer is full and doesn't contain \r\n */ message_end = 0; } } @@ -206,9 +205,9 @@ handle_user_input(void) { } } else { size_t msg_len = strlen(usrin); - /* Remove the trailing newline to add a carriage return */ - if (usrin[msg_len - 1] == '\n') + if (usrin[msg_len - 1] == '\n') { usrin[msg_len - 1] = '\0'; + } raw("privmsg #%s :%s\r\n", chan, usrin); } } -- cgit v1.2.3