libxtables: prefix/order - strtoui
This commit also throws out the redundant string_to_number_*.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
diff --git a/iptables.c b/iptables.c
index 07ace19..15b5b6f 100644
--- a/iptables.c
+++ b/iptables.c
@@ -488,7 +488,7 @@
{
unsigned int proto;
- if (string_to_number(pname, 0, UINT8_MAX, &proto) != -1) {
+ if (xtables_strtoui(pname, NULL, &proto, 0, UINT8_MAX)) {
char *protoname = proto_to_name(proto, nolookup);
if (protoname)
@@ -504,7 +504,7 @@
{
unsigned int proto;
- if (string_to_number(s, 0, UINT8_MAX, &proto) == -1) {
+ if (!xtables_strtoui(s, NULL, &proto, 0, UINT8_MAX)) {
struct protoent *pent;
/* first deal with the special case of 'all' to prevent
@@ -542,7 +542,7 @@
{
unsigned int rulenum;
- if (string_to_number(rule, 1, INT_MAX, &rulenum) == -1)
+ if (!xtables_strtoui(rule, NULL, &rulenum, 1, INT_MAX))
exit_error(PARAMETER_PROBLEM,
"Invalid rule number `%s'", rule);