Skip to content

Commit 68aded8

Browse files
committed
add guard around 'if' statement
1 parent 18f8e31 commit 68aded8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

kirc.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ handle_server_message(void) {
182182
}
183183
}
184184
if (message_end == MSG_MAX) {
185-
/* The buffer is full and doesn't contain \r\n */
186185
message_end = 0;
187186
}
188187
}
@@ -206,9 +205,9 @@ handle_user_input(void) {
206205
}
207206
} else {
208207
size_t msg_len = strlen(usrin);
209-
/* Remove the trailing newline to add a carriage return */
210-
if (usrin[msg_len - 1] == '\n')
208+
if (usrin[msg_len - 1] == '\n') {
211209
usrin[msg_len - 1] = '\0';
210+
}
212211
raw("privmsg #%s :%s\r\n", chan, usrin);
213212
}
214213
}

0 commit comments

Comments
 (0)