summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2002-07-13 10:13:27 +0000
committerderaadt <deraadt@openbsd.org>2002-07-13 10:13:27 +0000
commitdcebcac936993389ce74e6f90a7c8456912c85f8 (patch)
treec66efb9ad5f3464003a948408b16a5eb48dba532
parentuname translation (diff)
downloadwireguard-openbsd-dcebcac936993389ce74e6f90a7c8456912c85f8.tar.xz
wireguard-openbsd-dcebcac936993389ce74e6f90a7c8456912c85f8.zip
use snprintf
-rw-r--r--usr.sbin/mopd/common/pf.c6
-rw-r--r--usr.sbin/mopd/mopd/process.c9
2 files changed, 8 insertions, 7 deletions
diff --git a/usr.sbin/mopd/common/pf.c b/usr.sbin/mopd/common/pf.c
index 377f07b4037..ee40148832d 100644
--- a/usr.sbin/mopd/common/pf.c
+++ b/usr.sbin/mopd/common/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.4 2000/02/20 17:45:33 bitblt Exp $ */
+/* $OpenBSD: pf.c,v 1.5 2002/07/13 10:13:27 deraadt Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -34,7 +34,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: pf.c,v 1.4 2000/02/20 17:45:33 bitblt Exp $";
+static char rcsid[] = "$OpenBSD: pf.c,v 1.5 2002/07/13 10:13:27 deraadt Exp $";
#endif
#include <stdio.h>
@@ -116,7 +116,7 @@ pfInit(interface, mode, protocol, typ)
/* Go through all the minors and find one that isn't in use. */
do {
- (void) sprintf(device, "/dev/bpf%d", n++);
+ (void) snprintf(device, sizeof device, "/dev/bpf%d", n++);
fd = open(device, mode);
} while (fd < 0 && errno == EBUSY);
diff --git a/usr.sbin/mopd/mopd/process.c b/usr.sbin/mopd/mopd/process.c
index 8235d0b4213..223879349ed 100644
--- a/usr.sbin/mopd/mopd/process.c
+++ b/usr.sbin/mopd/mopd/process.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: process.c,v 1.8 2000/07/04 23:46:23 maja Exp $ */
+/* $OpenBSD: process.c,v 1.9 2002/07/13 10:13:27 deraadt Exp $ */
/*
* Copyright (c) 1993-95 Mats O Jansson. All rights reserved.
@@ -30,7 +30,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: process.c,v 1.8 2000/07/04 23:46:23 maja Exp $";
+static char rcsid[] = "$OpenBSD: process.c,v 1.9 2002/07/13 10:13:27 deraadt Exp $";
#endif
#include "os.h"
@@ -502,8 +502,9 @@ mopProcessDL(fd, ii, pkt, index, dst, src, trans, len)
/* to ask. My solution is to use the ethernet addr */
/* as filename. Implementing a database would be */
/* overkill. */
- sprintf(pfile,"%02x%02x%02x%02x%02x%02x%c",
- src[0],src[1],src[2],src[3],src[4],src[5],0);
+ snprintf(pfile,sizeof pfile,
+ "%02x%02x%02x%02x%02x%02x%c",
+ src[0],src[1],src[2],src[3],src[4],src[5],0);
}
tmpc = mopGetChar(pkt,index); /* Processor */