From ae6e159a78c1431d3382af192c509d80fab25ce4 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Fri, 15 Jun 2018 11:08:27 +0200 Subject: xtables: remove dead code inherited from ebtables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit previous patch shows this problem: xtables-eb.c: In function ‘parse_change_counters_rule’: xtables-eb.c:534:65: warning: logical ‘and’ of mutually exclusive tests is always false [-Wlogical-op] (argv[optind + 1][0] == '-' && (argv[optind + 1][1] < '0' && argv[optind + 1][1] > '9'))) ... so this never worked. Just remove it, the arg will be fed to strtol() -- No need to do this check. Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1149 Signed-off-by: Florian Westphal --- iptables/xtables-eb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'iptables') diff --git a/iptables/xtables-eb.c b/iptables/xtables-eb.c index bfa66d7d..72559075 100644 --- a/iptables/xtables-eb.c +++ b/iptables/xtables-eb.c @@ -530,8 +530,7 @@ static int parse_change_counters_rule(int argc, char **argv, int *rule_nr, int * char *buffer; int ret = 0; - if (optind + 1 >= argc || (argv[optind][0] == '-' && (argv[optind][1] < '0' || argv[optind][1] > '9')) || - (argv[optind + 1][0] == '-' && (argv[optind + 1][1] < '0' && argv[optind + 1][1] > '9'))) + if (optind + 1 >= argc || argv[optind][0] == '-' || argv[optind + 1][0] == '-') xtables_error(PARAMETER_PROBLEM, "The command -C needs at least 2 arguments"); if (optind + 2 < argc && (argv[optind + 2][0] != '-' || (argv[optind + 2][1] >= '0' && argv[optind + 2][1] <= '9'))) { -- cgit v1.2.3