summaryrefslogtreecommitdiffstats
path: root/libxtables/xtoptions.c
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2023-11-22 20:43:40 +0100
committerPhil Sutter <phil@nwl.cc>2023-11-23 18:01:21 +0100
commitf7056d0fdb43e91497615ed6f21753ee3c91db63 (patch)
tree6b8b486e2f488175d60f1c075c484db2c94b1f64 /libxtables/xtoptions.c
parent1af6984c57cce5169491d308b58a9c85464b2159 (diff)
libxtables: Introduce struct xt_option_entry::base
Enable guided option parser users to parse integer values with a fixed base. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'libxtables/xtoptions.c')
-rw-r--r--libxtables/xtoptions.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libxtables/xtoptions.c b/libxtables/xtoptions.c
index 25540f8b..4fd0e70e 100644
--- a/libxtables/xtoptions.c
+++ b/libxtables/xtoptions.c
@@ -161,7 +161,8 @@ static void xtopt_parse_int(struct xt_option_call *cb)
if (cb->entry->max != 0)
lmax = cb->entry->max;
- if (!xtables_strtoul(cb->arg, NULL, &value, lmin, lmax))
+ if (!xtables_strtoul_base(cb->arg, NULL, &value,
+ lmin, lmax, cb->entry->base))
xt_params->exit_err(PARAMETER_PROBLEM,
"%s: bad value for option \"--%s\", "
"or out of range (%ju-%ju).\n",