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/bgpctl/irr_output.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/bgpctl/irr_output.c')
| -rw-r--r-- | usr.sbin/bgpctl/irr_output.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/bgpctl/irr_output.c b/usr.sbin/bgpctl/irr_output.c index 3b93c32b0c6..5e06a079db4 100644 --- a/usr.sbin/bgpctl/irr_output.c +++ b/usr.sbin/bgpctl/irr_output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: irr_output.c,v 1.13 2007/03/05 17:28:21 henning Exp $ */ +/* $OpenBSD: irr_output.c,v 1.14 2013/10/27 18:49:25 guenther Exp $ */ /* * Copyright (c) 2007 Henning Brauer <henning@openbsd.org> @@ -196,7 +196,6 @@ void print_rule(FILE *fh, struct policy_item *pi, char *sourceas, struct irr_prefix *prefix) { - char *fmt = "allow quick %s %s%s%s%s%s\n"; char *peer = "any"; char *action = ""; char *dir; @@ -240,5 +239,6 @@ print_rule(FILE *fh, struct policy_item *pi, char *sourceas, } } - fprintf(fh, fmt, dir, peer, srcas[0], srcas[1], pbuf, action); + fprintf(fh, "allow quick %s %s%s%s%s%s\n", dir, peer, + srcas[0], srcas[1], pbuf, action); } |
