aboutsummaryrefslogtreecommitdiffstats
path: root/kirc.c
diff options
context:
space:
mode:
authormcpcpc <michaelczigler@icloud.com>2020-09-12 23:04:08 -0400
committermcpcpc <michaelczigler@icloud.com>2020-09-12 23:04:08 -0400
commit68aded8d7dce36007bc3ba80a35719ac4c89385f (patch)
tree575354b0dbf7d384904ce30757a89c11fd512688 /kirc.c
parentuse return macros (diff)
downloadkirc-68aded8d7dce36007bc3ba80a35719ac4c89385f.tar.gz
kirc-68aded8d7dce36007bc3ba80a35719ac4c89385f.tar.bz2
kirc-68aded8d7dce36007bc3ba80a35719ac4c89385f.tar.xz
kirc-68aded8d7dce36007bc3ba80a35719ac4c89385f.tar.zst
kirc-68aded8d7dce36007bc3ba80a35719ac4c89385f.zip
add guard around 'if' statement
Diffstat (limited to '')
-rw-r--r--kirc.c5
1 files changed, 2 insertions, 3 deletions
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);
}
}