summaryrefslogtreecommitdiffstats
path: root/battlestar
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2010-04-02 15:34:16 +0000
committerchristos <christos@NetBSD.org>2010-04-02 15:34:16 +0000
commitd696b06def90070e944c17e06ec076bdcdca4c7e (patch)
tree7d9cd52804912c3e4fd7304c37888746b0c9d043 /battlestar
parent21d2189c49223d1104b3c8bcd02d668243d118f1 (diff)
downloadbsdgames-darwin-d696b06def90070e944c17e06ec076bdcdca4c7e.tar.gz
bsdgames-darwin-d696b06def90070e944c17e06ec076bdcdca4c7e.tar.zst
bsdgames-darwin-d696b06def90070e944c17e06ec076bdcdca4c7e.zip
handle ctime returning NULL.
Diffstat (limited to 'battlestar')
-rw-r--r--battlestar/command6.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/battlestar/command6.c b/battlestar/command6.c
index be46f0a7..785d7dfd 100644
--- a/battlestar/command6.c
+++ b/battlestar/command6.c
@@ -1,4 +1,4 @@
-/* $NetBSD: command6.c,v 1.5 2009/08/12 05:20:38 dholland Exp $ */
+/* $NetBSD: command6.c,v 1.6 2010/04/02 15:35:32 christos Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)com6.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: command6.c,v 1.5 2009/08/12 05:20:38 dholland Exp $");
+__RCSID("$NetBSD: command6.c,v 1.6 2010/04/02 15:35:32 christos Exp $");
#endif
#endif /* not lint */
@@ -120,17 +120,14 @@ static void
post(int ch)
{
time_t tv;
- char *date;
sigset_t isigset, osigset;
sigemptyset(&isigset);
sigaddset(&isigset, SIGINT);
sigprocmask(SIG_BLOCK, &isigset, &osigset);
tv = time(NULL);
- date = ctime(&tv);
- date[24] = '\0';
if (score_fp != NULL) {
- fprintf(score_fp, "%s %8s %c%20s", date, username,
+ fprintf(score_fp, "%24.24s %8s %c%20s", ctime(&t), username,
ch, rate());
if (wiz)
fprintf(score_fp, " wizard\n");