diff options
author | 2013-10-27 18:49:25 +0000 | |
---|---|---|
committer | 2013-10-27 18:49:25 +0000 | |
commit | 390b7edb69e257eeb514689ee52c15ebd69cccda (patch) | |
tree | 3cc5e144428de10e41d3b69c08f6f2897d53b00a /usr.sbin/tcpdump/print-bootp.c | |
parent | If a constant string needs a name, use a static const array instead of a (diff) | |
download | wireguard-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.c | 4 |
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) \ |