aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/shutdown.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2023-12-17 16:35:36 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2023-12-17 16:35:36 +0100
commit50ec4fe3b3dfb7243e1389bf1b60b1a557cff7c3 (patch)
tree67a72846e66ee07c424aaf90e0c611b58dee13c0 /FICS/shutdown.c
parenta8b59b34e5c352ddd9e2438c166c9dd1d795ad28 (diff)
Fixed the type of the var passed to strltime()
Diffstat (limited to 'FICS/shutdown.c')
-rw-r--r--FICS/shutdown.c45
1 files changed, 27 insertions, 18 deletions
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)