From 284a3e67563a8984fb0f513e1dc27a2364a12ce2 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 22 Oct 2019 22:55:08 +0200 Subject: xshared: Share a common implementation of parse_rulenumber() The function is really small, but still copied four times. Signed-off-by: Phil Sutter Acked-by: Pablo Neira Ayuso --- iptables/xtables.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'iptables/xtables.c') diff --git a/iptables/xtables.c b/iptables/xtables.c index 6dfa3f11..bb76e6a7 100644 --- a/iptables/xtables.c +++ b/iptables/xtables.c @@ -327,18 +327,6 @@ opt2char(int option) */ /* Christophe Burki wants `-p 6' to imply `-m tcp'. */ -/* Can't be zero. */ -static int -parse_rulenumber(const char *rule) -{ - unsigned int rulenum; - - if (!xtables_strtoui(rule, NULL, &rulenum, 1, INT_MAX)) - xtables_error(PARAMETER_PROBLEM, - "Invalid rule number `%s'", rule); - - return rulenum; -} static void set_option(unsigned int *options, unsigned int option, uint8_t *invflg, -- cgit v1.2.3