From 5deea44551e337f4e32d0df149ca4387314fb6f1 Mon Sep 17 00:00:00 2001 From: Test_User Date: Sun, 13 Aug 2023 03:32:02 -0400 Subject: Add message logging for non-verbose if the message caused an exit, also fix the missing newline on a message that will probably never be printed. --- client_network.c | 2 +- main.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/client_network.c b/client_network.c index 20d2d2b..bdca265 100644 --- a/client_network.c +++ b/client_network.c @@ -284,7 +284,7 @@ int client_join_handler(uint64_t argc, struct string *argv) { { // Mostly to get rid of the compiler complaining about conversion to unsigned time_t ctime = time(NULL); if (ctime < 0) { - WRITES(2, STRING("Please check your clock.")); + WRITES(2, STRING("Please check your clock.\n")); return 1; } current_time = (uint64_t)ctime; diff --git a/main.c b/main.c index eca82be..f1a51bd 100644 --- a/main.c +++ b/main.c @@ -424,6 +424,10 @@ int main(void) { #endif int err = func(source, argc, argv); if (err) { +#if !LOGALL + WRITES(2, STRING("Message was: [Server] ")); + write(2, full_msg.data, msg_len+1); +#endif WRITES(1, STRING("Disconnecting by result of the network command handler...\n")); return 0; } -- cgit v1.2.3