diff options
author | Phil Sutter <phil@nwl.cc> | 2018-08-02 17:05:16 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-08-04 14:26:46 +0200 |
commit | 1cc09188079a64dc8b733f198c959cfb441e6e20 (patch) | |
tree | 4de4832ed055c237569b22491e13e728d3a463dc /iptables/iptables-xml.c | |
parent | 78b9d438037f2c83a7bbb73eb1b86cc295967905 (diff) |
xshared: Consolidate parse_counters()
Move this helper function into xshared. While being at it, drop the need
for temporary variables and take over null pointer tolerance from the
implementation in iptables-xml.c.
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'iptables/iptables-xml.c')
-rw-r--r-- | iptables/iptables-xml.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/iptables/iptables-xml.c b/iptables/iptables-xml.c index a1b09f3a..8ba45d55 100644 --- a/iptables/iptables-xml.c +++ b/iptables/iptables-xml.c @@ -50,22 +50,6 @@ print_usage(const char *name, const char *version) exit(1); } -static int -parse_counters(char *string, struct xt_counters *ctr) -{ - __u64 *pcnt, *bcnt; - - if (string != NULL) { - pcnt = &ctr->pcnt; - bcnt = &ctr->bcnt; - return (sscanf - (string, "[%llu:%llu]", - (unsigned long long *)pcnt, - (unsigned long long *)bcnt) == 2); - } else - return (0 == 2); -} - /* global new argv and argc */ static char *newargv[255]; static unsigned int newargc; |