From 87b5b9e2240e7cd5487d160cc3e059c61622ce75 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 19 Jul 2018 18:31:54 +0200 Subject: 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 Signed-off-by: Florian Westphal --- iptables/ip6tables.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'iptables/ip6tables.c') diff --git a/iptables/ip6tables.c b/iptables/ip6tables.c index 2cb115f5..3bd1e5fa 100644 --- a/iptables/ip6tables.c +++ b/iptables/ip6tables.c @@ -1351,7 +1351,10 @@ static void command_match(struct iptables_command_state *cs) int do_command6(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 ip6t_entry *e = NULL; unsigned int nsaddrs = 0, ndaddrs = 0; struct in6_addr *saddrs = NULL, *daddrs = NULL; @@ -1374,10 +1377,6 @@ int do_command6(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_command6 gets called * a second time */ optind = 0; -- cgit v1.2.3