]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
iptables: Remove unnecessary braces.
authorVarsha Rao <rvarsha016@gmail.com>
Wed, 29 Mar 2017 19:27:43 +0000 (00:57 +0530)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 6 Apr 2017 16:23:09 +0000 (18:23 +0200)
Remove braces which are not required, to fix the check patch issue.
The following coccinelle script was used to fix this issue.

@@
expression e;
expression e1;
@@
if(e)
-{
 e1;
-}

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
iptables/iptables-standalone.c
iptables/iptables.c
iptables/xtables-standalone.c
iptables/xtables-translate.c

index 4da1d7f8b28edafb49a0340a9abff05a57c8d7ba..c211fb7399dac8ce2ecdd5bffe2b9e6f14cf9553 100644 (file)
@@ -73,9 +73,8 @@ iptables_main(int argc, char *argv[])
                        fprintf(stderr, "iptables: %s.\n",
                                iptc_strerror(errno));
                }
-               if (errno == EAGAIN) {
+               if (errno == EAGAIN)
                        exit(RESOURCE_PROBLEM);
-               }
        }
 
        exit(!ret);
index 62731c5ebb5f1a021f8bc1ab79b64f1f59290550..97cbda91cfdca1df9b4ed52579820743e9a1c39e 100644 (file)
@@ -1114,9 +1114,8 @@ void print_rule4(const struct ipt_entry *e,
                       e->ip.invflags & IPT_INV_FRAG ? " !" : "");
 
        /* Print matchinfo part */
-       if (e->target_offset) {
+       if (e->target_offset)
                IPT_MATCH_ITERATE(e, print_match_save, &e->ip);
-       }
 
        /* print counters for iptables -R */
        if (counters < 0)
index 355a446096ce5e262f174950d7cb6e0897b8de19..139c477fea8d1e8320d2ccf93a40f06aeeb2cf23 100644 (file)
@@ -85,9 +85,8 @@ xtables_main(int family, const char *progname, int argc, char *argv[])
                        fprintf(stderr, "iptables: %s.\n",
                                nft_strerror(errno));
                }
-               if (errno == EAGAIN) {
+               if (errno == EAGAIN)
                        exit(RESOURCE_PROBLEM);
-               }
        }
 
        exit(!ret);
index 00de019000f343240f36d854ca3bc40d9f13d950..e049f24e975f456f9b00981f0d68a9e4ae6f6088 100644 (file)
@@ -236,9 +236,8 @@ static int do_command_xlate(struct nft_handle *h, int argc, char *argv[],
        switch (p.command) {
        case CMD_APPEND:
                ret = 1;
-               if (!xlate(h, &p, &cs, &args, true, nft_rule_xlate_add)) {
+               if (!xlate(h, &p, &cs, &args, true, nft_rule_xlate_add))
                        print_ipt_cmd(argc, argv);
-               }
                break;
        case CMD_DELETE:
                break;
@@ -250,9 +249,8 @@ static int do_command_xlate(struct nft_handle *h, int argc, char *argv[],
                break;
        case CMD_INSERT:
                ret = 1;
-               if (!xlate(h, &p, &cs, &args, false, nft_rule_xlate_add)) {
+               if (!xlate(h, &p, &cs, &args, false, nft_rule_xlate_add))
                        print_ipt_cmd(argc, argv);
-               }
                break;
        case CMD_FLUSH:
                if (p.chain) {