summaryrefslogtreecommitdiffstats
path: root/xtoptions.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2011-05-24 02:03:00 +0200
committerJan Engelhardt <jengelh@medozas.de>2011-05-24 14:54:27 +0200
commit5e35b7d435c5bc1b3641f76a6601a55d32d63ac8 (patch)
tree99ed936cc2a695ba6092777cbc961dfdb184c117 /xtoptions.c
parent319046c3f96f810f81a5a2e6189ba87527e882f1 (diff)
libxtables: more detailed error message on multi-int parsing
Now shows where exactly the error is. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'xtoptions.c')
-rw-r--r--xtoptions.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/xtoptions.c b/xtoptions.c
index ec2269b2..9884b7df 100644
--- a/xtoptions.c
+++ b/xtoptions.c
@@ -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;