From 50ec4fe3b3dfb7243e1389bf1b60b1a557cff7c3 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sun, 17 Dec 2023 16:35:36 +0100 Subject: Fixed the type of the var passed to strltime() --- FICS/shutdown.c | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) (limited to 'FICS') diff --git a/FICS/shutdown.c b/FICS/shutdown.c index 26e0eaa..da26e26 100644 --- a/FICS/shutdown.c +++ b/FICS/shutdown.c @@ -14,29 +14,38 @@ PRIVATE int shutdownStartTime; PRIVATE char downer[1024]; PRIVATE char reason[1024]; -PUBLIC void output_shut_mess() +PUBLIC void +output_shut_mess() { - int shuttime = time(0); - fprintf(stderr, "FICS: Shutting down at %s\n", strltime(&shuttime)); + time_t shuttime = time(NULL); + + fprintf(stderr, "FICS: Shutting down at %s\n", strltime(&shuttime)); } -PUBLIC void ShutDown(void) +PUBLIC void +ShutDown(void) { - int p1; - int shuttime = time(0); + time_t shuttime = time(NULL); - for (p1 = 0; p1 < p_num; p1++) { - if (parray[p1].status != PLAYER_PROMPT) - continue; - pprintf(p1, "\n\n **** Server shutdown ordered by %s. ****\n", downer); - if (reason[0] != '\0') - pprintf(p1, "\n **** We are going down because: %s. ****\n", reason); - } - TerminateCleanup(); - fprintf(stderr, "FICS: Shut down ordered at %s by %s.\n", strltime(&shuttime), downer); - output_shut_mess(); - net_close(); - exit(0); + for (int p1 = 0; p1 < p_num; p1++) { + if (parray[p1].status != PLAYER_PROMPT) + continue; + + pprintf(p1, "\n\n **** Server shutdown ordered by %s. " + "****\n", downer); + + if (reason[0] != '\0') { + pprintf(p1, "\n **** We are going down because: " + "%s. ****\n", reason); + } + } + + TerminateCleanup(); + fprintf(stderr, "FICS: Shut down ordered at %s by %s.\n", + strltime(&shuttime), downer); + output_shut_mess(); + net_close(); + exit(0); } PUBLIC void ShutHeartBeat(void) -- cgit v1.2.3