summaryrefslogtreecommitdiffstats
path: root/hack/hack.unix.c
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2009-06-07 20:13:18 +0000
committerdholland <dholland@NetBSD.org>2009-06-07 20:13:18 +0000
commit9a33f5bfb221170e823efd3c33ab5d331baf7c74 (patch)
tree56cfd04dbcbacdc38273193be59800509d41bc7b /hack/hack.unix.c
parentb462731cbc1198051cd39ad2f95b1027e441067d (diff)
downloadbsdgames-darwin-9a33f5bfb221170e823efd3c33ab5d331baf7c74.tar.gz
bsdgames-darwin-9a33f5bfb221170e823efd3c33ab5d331baf7c74.tar.zst
bsdgames-darwin-9a33f5bfb221170e823efd3c33ab5d331baf7c74.zip
sprintf -> snprintf, plus some use of strlcpy/strlcat where appropriate
XXX: there's still one sprintf left which will take some hacking to expunge.
Diffstat (limited to 'hack/hack.unix.c')
-rw-r--r--hack/hack.unix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hack/hack.unix.c b/hack/hack.unix.c
index 23425ef5..11cd9392 100644
--- a/hack/hack.unix.c
+++ b/hack/hack.unix.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.unix.c,v 1.11 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.unix.c,v 1.12 2009/06/07 20:13:18 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.unix.c,v 1.11 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.unix.c,v 1.12 2009/06/07 20:13:18 dholland Exp $");
#endif /* not lint */
/* This file collects some Unix dependencies; hack.pager.c contains some more */
@@ -123,7 +123,7 @@ getdatestr(void)
static char datestr[7];
struct tm *lt = getlt();
- (void) sprintf(datestr, "%02d%02d%02d",
+ (void) snprintf(datestr, sizeof(datestr), "%02d%02d%02d",
lt->tm_year % 100, lt->tm_mon + 1, lt->tm_mday);
return (datestr);
}