summaryrefslogtreecommitdiff
path: root/sbin/slattach
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-06-02 18:45:40 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-06-02 18:45:40 +0000
commit5d3364f7d4c3437c5bb80abdffe8ec267d6a8368 (patch)
treeccb607ba8fe725721b65f9b94574cbacac0ee86e /sbin/slattach
parent23e83cb3a630024238a77045b226ee85ab700beb (diff)
snprintf
Diffstat (limited to 'sbin/slattach')
-rw-r--r--sbin/slattach/slattach.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/slattach/slattach.c b/sbin/slattach/slattach.c
index 0d3570df548..1da756af1c7 100644
--- a/sbin/slattach/slattach.c
+++ b/sbin/slattach/slattach.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: slattach.c,v 1.5 1996/11/13 07:17:20 downsj Exp $ */
+/* $OpenBSD: slattach.c,v 1.6 1999/06/02 18:45:39 deraadt Exp $ */
/* $NetBSD: slattach.c,v 1.17 1996/05/19 21:57:39 jonathan Exp $ */
/*
@@ -47,7 +47,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)slattach.c 8.2 (Berkeley) 1/7/94";
#else
-static char rcsid[] = "$OpenBSD: slattach.c,v 1.5 1996/11/13 07:17:20 downsj Exp $";
+static char rcsid[] = "$OpenBSD: slattach.c,v 1.6 1999/06/02 18:45:39 deraadt Exp $";
#endif
#endif /* not lint */
@@ -163,7 +163,8 @@ main(argc, argv)
;
if(dev[i] == '/')
i++;
- (void) sprintf(pidfilename, "%sslip.%s.pid", _PATH_VARRUN, dev + i);
+ (void) snprintf(pidfilename, sizeof pidfilename,
+ "%sslip.%s.pid", _PATH_VARRUN, dev + i);
truncate(pidfilename, 0); /* If this fails, so will the next one... */
if ((pidfile = fopen(pidfilename, "w")) != NULL) {
fprintf(pidfile, "%d\n", pid);