diff options
author | 2003-04-05 17:15:06 +0000 | |
---|---|---|
committer | 2003-04-05 17:15:06 +0000 | |
commit | 30fdd9d956169fd60b909ada167fed1b59d2b364 (patch) | |
tree | fb358b53103024b7f974283cf1838fd4684922b7 | |
parent | simple snprintf and strlcpy; henning ok (diff) | |
download | wireguard-openbsd-30fdd9d956169fd60b909ada167fed1b59d2b364.tar.xz wireguard-openbsd-30fdd9d956169fd60b909ada167fed1b59d2b364.zip |
snprintf; ok miod ho henning
-rw-r--r-- | usr.bin/nm/nm.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/nm/nm.c b/usr.bin/nm/nm.c index 8cc42019538..0e08b42f7b4 100644 --- a/usr.bin/nm/nm.c +++ b/usr.bin/nm/nm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nm.c,v 1.16 2002/02/16 21:27:50 millert Exp $ */ +/* $OpenBSD: nm.c,v 1.17 2003/04/05 17:15:06 deraadt Exp $ */ /* $NetBSD: nm.c,v 1.7 1996/01/14 23:04:03 pk Exp $ */ /* @@ -47,7 +47,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)nm.c 8.1 (Berkeley) 6/6/93"; #endif -static char rcsid[] = "$OpenBSD: nm.c,v 1.16 2002/02/16 21:27:50 millert Exp $"; +static char rcsid[] = "$OpenBSD: nm.c,v 1.17 2003/04/05 17:15:06 deraadt Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -259,8 +259,10 @@ show_archive(fname, fp) * on each output line */ p = name; - if (print_file_each_line) - p += sprintf(p, "%s:", fname); + if (print_file_each_line) { + snprintf(p, baselen, "%s:", fname); + p += strlen(p); + } #ifdef AR_EFMT1 /* * BSD 4.4 extended AR format: #1/<namelen>, with name as the |