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/xtables-eb-translate.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'iptables/xtables-eb-translate.c') diff --git a/iptables/xtables-eb-translate.c b/iptables/xtables-eb-translate.c index 42b88e35..1e66bf71 100644 --- a/iptables/xtables-eb-translate.c +++ b/iptables/xtables-eb-translate.c @@ -288,7 +288,10 @@ static int do_commandeb_xlate(struct nft_handle *h, int argc, char *argv[], char unsigned int flags = 0; struct xtables_target *t, *w; struct xtables_match *m; - struct iptables_command_state cs; + struct iptables_command_state cs = { + .argv = argv, + .eb.bitmask = EBT_NOPROTO, + }; char command = 'h'; const char *chain = NULL; int exec_style = EXEC_STYLE_PRG; @@ -299,9 +302,6 @@ static int do_commandeb_xlate(struct nft_handle *h, int argc, char *argv[], char .table = *table, }; - memset(&cs, 0, sizeof(cs)); - cs.argv = argv; - if (nft_init(h, xtables_bridge) < 0) xtables_error(OTHER_PROBLEM, "Could not initialize nftables layer."); @@ -328,7 +328,6 @@ static int do_commandeb_xlate(struct nft_handle *h, int argc, char *argv[], char /* prevent getopt to spoil our error reporting */ opterr = false; - cs.eb.bitmask = EBT_NOPROTO; printf("nft "); /* Getopt saves the day */ -- cgit v1.2.3