summaryrefslogtreecommitdiffstats
path: root/hack/hack.main.c
diff options
context:
space:
mode:
Diffstat (limited to 'hack/hack.main.c')
-rw-r--r--hack/hack.main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hack/hack.main.c b/hack/hack.main.c
index be76bc55..28eec738 100644
--- a/hack/hack.main.c
+++ b/hack/hack.main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.main.c,v 1.11 2009/06/07 18:30:39 dholland Exp $ */
+/* $NetBSD: hack.main.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.main.c,v 1.11 2009/06/07 18:30:39 dholland Exp $");
+__RCSID("$NetBSD: hack.main.c,v 1.12 2009/06/07 20:13:18 dholland Exp $");
#endif /* not lint */
#include <signal.h>
@@ -306,7 +306,7 @@ main(int argc, char *argv[])
}
#endif
setftty();
- (void) sprintf(SAVEF, "save/%d%s", getuid(), plname);
+ (void) snprintf(SAVEF, sizeof(SAVEF), "save/%d%s", getuid(), plname);
regularize(SAVEF + 5); /* avoid . or / in name */
if ((fd = open(SAVEF, O_RDONLY)) >= 0 &&
(uptodate(fd) || unlink(SAVEF) == 666)) {