]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
libxtables: more detailed error message on multi-int parsing
authorJan Engelhardt <jengelh@medozas.de>
Tue, 24 May 2011 00:03:00 +0000 (02:03 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Tue, 24 May 2011 12:54:27 +0000 (14:54 +0200)
Now shows where exactly the error is.

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
xtoptions.c

index ec2269b2b211805b3fddcef2eaa4772979d3d0b3..9884b7df7db949b0340754e74ce7bc9710aba654 100644 (file)
@@ -206,13 +206,14 @@ static void xtopt_parse_mint(struct xt_option_call *cb)
                                cb->ext_name, entry->name, maxiter);
                if (!xtables_strtoui(arg, &end, &value, 0, UINT32_MAX))
                        xt_params->exit_err(PARAMETER_PROBLEM,
-                               "%s: bad value for option \"--%s\", "
-                               "or out of range (0-%u).\n",
-                               cb->ext_name, entry->name, UINT32_MAX);
+                               "%s: bad value for option \"--%s\" near "
+                               "\"%s\", or out of range (0-%u).\n",
+                               cb->ext_name, entry->name, arg, UINT32_MAX);
                if (*end != '\0' && *end != sep)
                        xt_params->exit_err(PARAMETER_PROBLEM,
                                "%s: Argument to \"--%s\" has unexpected "
-                               "characters.\n", cb->ext_name, entry->name);
+                               "characters near \"%s\".\n",
+                               cb->ext_name, entry->name, end);
                if (cb->nvals < ARRAY_SIZE(cb->val.u32_range)) {
                        if (entry->type == XTTYPE_UINT8RC)
                                cb->val.u8_range[cb->nvals] = value;