diff options
author | Phil Sutter <phil@nwl.cc> | 2018-07-19 18:31:54 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-07-19 22:15:12 +0200 |
commit | 87b5b9e2240e7cd5487d160cc3e059c61622ce75 (patch) | |
tree | 490686a1485eed2d1a9b3a055a797f1983f97794 /iptables/iptables.c | |
parent | 907da5c505b219537586f7c2bdb7320c4f97386f (diff) |
iptables: replace memset by c99-style initializers
This cleans up a few obvious cases identified by grepping the source
code for 'memset'.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/iptables.c')
-rw-r--r-- | iptables/iptables.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/iptables/iptables.c b/iptables/iptables.c index 08ea7afa..428fae4e 100644 --- a/iptables/iptables.c +++ b/iptables/iptables.c @@ -1345,7 +1345,10 @@ static void command_match(struct iptables_command_state *cs) int do_command4(int argc, char *argv[], char **table, struct xtc_handle **handle, bool restore) { - struct iptables_command_state cs; + struct iptables_command_state cs = { + .jumpto = "", + .argv = argv, + }; struct ipt_entry *e = NULL; unsigned int nsaddrs = 0, ndaddrs = 0; struct in_addr *saddrs = NULL, *smasks = NULL; @@ -1367,10 +1370,6 @@ int do_command4(int argc, char *argv[], char **table, struct xtables_target *t; unsigned long long cnt; - memset(&cs, 0, sizeof(cs)); - cs.jumpto = ""; - cs.argv = argv; - /* re-set optind to 0 in case do_command4 gets called * a second time */ optind = 0; |