summaryrefslogtreecommitdiffstats
path: root/extensions/libip6t_limit.c
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/libip6t_limit.c')
-rw-r--r--extensions/libip6t_limit.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/extensions/libip6t_limit.c b/extensions/libip6t_limit.c
index 3b0318ba..e794675c 100644
--- a/extensions/libip6t_limit.c
+++ b/extensions/libip6t_limit.c
@@ -98,7 +98,7 @@ parse(int c, char **argv, int invert, unsigned int *flags,
struct ip6t_entry_match **match)
{
struct ip6t_rateinfo *r = (struct ip6t_rateinfo *)(*match)->data;
- int num;
+ unsigned int num;
switch(c) {
case '%':
@@ -115,8 +115,7 @@ parse(int c, char **argv, int invert, unsigned int *flags,
exit_error(PARAMETER_PROBLEM,
"Unexpected `!' after --limit-burst");
- num = string_to_number(optarg, 0, 10000);
- if (num <= 0)
+ if (string_to_number(optarg, 0, 10000, &num) <= 0)
exit_error(PARAMETER_PROBLEM,
"bad --limit-burst `%s'", optarg);
r->burst = num;