summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2023-09-08 07:44:35 -0400
committerTest_User <hax@andrewyu.org>2023-09-08 07:44:35 -0400
commitf79a5dbfbadf78baf5683eede02a8454e403f58e (patch)
treeb35b392954878edeef139c9fd2c4dde15ca05f5a
parent9a1fdcc9d24fe8dd20cacee0e25a57c6219651a2 (diff)
downloadcoupserv-f79a5dbfbadf78baf5683eede02a8454e403f58e.tar.gz
coupserv-f79a5dbfbadf78baf5683eede02a8454e403f58e.zip
warnings overwriting what they're warning about is fun
-rw-r--r--main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.c b/main.c
index c02c0c4..6aff2de 100644
--- a/main.c
+++ b/main.c
@@ -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"));