summaryrefslogtreecommitdiff
path: root/games/atc/log.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-06 18:50:39 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-04-06 18:50:39 +0000
commit0f64621783b3f46a4851826b9f4284e3c9dbeb61 (patch)
tree352fcb09d9321309ec519dc3144147a24bd64bda /games/atc/log.c
parent997f28507be542389b846c45806474af6bbfdedc (diff)
2451 lines of strdup/sprintf/strcpy whacking. mostly ok'd by pjanzen
already, but he may have later changes to make still.
Diffstat (limited to 'games/atc/log.c')
-rw-r--r--games/atc/log.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/games/atc/log.c b/games/atc/log.c
index 74a4b292d3f..f8246deca37 100644
--- a/games/atc/log.c
+++ b/games/atc/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.10 2002/06/23 03:01:12 deraadt Exp $ */
+/* $OpenBSD: log.c,v 1.11 2003/04/06 18:50:36 deraadt Exp $ */
/* $NetBSD: log.c,v 1.3 1995/03/21 15:04:21 cgd Exp $ */
/*-
@@ -50,7 +50,7 @@
#if 0
static char sccsid[] = "@(#)log.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: log.c,v 1.10 2002/06/23 03:01:12 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: log.c,v 1.11 2003/04/06 18:50:36 deraadt Exp $";
#endif
#endif /* not lint */
@@ -90,13 +90,14 @@ timestr(t)
static char s[80];
if (DAY(t) > 0)
- (void)sprintf(s, "%dd+%02dhrs", DAY(t), HOUR(t));
+ (void)snprintf(s, sizeof s, "%dd+%02dhrs", DAY(t), HOUR(t));
else if (HOUR(t) > 0)
- (void)sprintf(s, "%d:%02d:%02d", HOUR(t), MINUTES(t), SEC(t));
+ (void)snprintf(s, sizeof s, "%d:%02d:%02d",
+ HOUR(t), MINUTES(t), SEC(t));
else if (MINUTES(t) > 0)
- (void)sprintf(s, "%d:%02d", MINUTES(t), SEC(t));
+ (void)snprintf(s, sizeof s, "%d:%02d", MINUTES(t), SEC(t));
else if (SEC(t) > 0)
- (void)sprintf(s, ":%02d", SEC(t));
+ (void)snprintf(s, sizeof s, ":%02d", SEC(t));
else
*s = '\0';