summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tcpdump/print-bootp.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2013-10-27 18:49:25 +0000
committerguenther <guenther@openbsd.org>2013-10-27 18:49:25 +0000
commit390b7edb69e257eeb514689ee52c15ebd69cccda (patch)
tree3cc5e144428de10e41d3b69c08f6f2897d53b00a /usr.sbin/tcpdump/print-bootp.c
parentIf a constant string needs a name, use a static const array instead of a (diff)
downloadwireguard-openbsd-390b7edb69e257eeb514689ee52c15ebd69cccda.tar.xz
wireguard-openbsd-390b7edb69e257eeb514689ee52c15ebd69cccda.zip
If a constant string needs a name, use a static const array instead of a
pointer or non-const array, as that minimizes the symbols, maximizes the placement into read-only memory, and avoids warnings from gcc -Wformat=2 when they're used as format strings. ok deraadt@
Diffstat (limited to 'usr.sbin/tcpdump/print-bootp.c')
-rw-r--r--usr.sbin/tcpdump/print-bootp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/tcpdump/print-bootp.c b/usr.sbin/tcpdump/print-bootp.c
index 7991f0d7d65..f7fdfd73ddc 100644
--- a/usr.sbin/tcpdump/print-bootp.c
+++ b/usr.sbin/tcpdump/print-bootp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-bootp.c,v 1.17 2009/10/27 23:59:55 deraadt Exp $ */
+/* $OpenBSD: print-bootp.c,v 1.18 2013/10/27 18:49:25 guenther Exp $ */
/*
* Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997
@@ -443,7 +443,7 @@ static void
cmu_print(register const u_char *bp, register u_int length)
{
register const struct cmu_vend *cmu;
- char *fmt = " %s:%s";
+ static const char fmt[] = " %s:%s";
#define PRINTCMUADDR(m, s) { TCHECK(cmu->m); \
if (cmu->m.s_addr != 0) \