diff options
author | Test_User <hax@andrewyu.org> | 2023-09-08 07:44:35 -0400 |
---|---|---|
committer | Test_User <hax@andrewyu.org> | 2023-09-08 07:44:35 -0400 |
commit | f79a5dbfbadf78baf5683eede02a8454e403f58e (patch) | |
tree | b35b392954878edeef139c9fd2c4dde15ca05f5a | |
parent | 9a1fdcc9d24fe8dd20cacee0e25a57c6219651a2 (diff) | |
download | coupserv-f79a5dbfbadf78baf5683eede02a8454e403f58e.tar.gz coupserv-f79a5dbfbadf78baf5683eede02a8454e403f58e.zip |
warnings overwriting what they're warning about is fun
Diffstat (limited to '')
-rw-r--r-- | main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -176,14 +176,14 @@ void *client_loop(void *ign) { write(1, full_msg.data, msg_len); WRITES(1, STRING("\x1b[0m\n")); #else - write(1, full_msg.data, msg_len+1); // +1: \n + write(1, full_msg.data, msg_len+(full_msg.data[msg_len] == '\r' ? 2 : 1)); // +2 or 1: \r\n or \n #endif #endif if (func == 0) { #if !LOGALL WRITES(2, STRING("[Client] ")); - write(2, full_msg.data, msg_len+1); // +1: \n + write(2, full_msg.data, msg_len+(full_msg.data[msg_len] == '\r' ? 2 : 1)); #endif WRITES(2, STRING("WARNING: Command is unknown, ignoring...\n")); WRITES(2, STRING("\n")); |