summaryrefslogtreecommitdiffstats
path: root/extensions/libipt_length.c
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/libipt_length.c')
-rw-r--r--extensions/libipt_length.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/extensions/libipt_length.c b/extensions/libipt_length.c
index 7ea5084d..ee2af943 100644
--- a/extensions/libipt_length.c
+++ b/extensions/libipt_length.c
@@ -35,11 +35,9 @@ init(struct ipt_entry_match *m, unsigned int *nfcache)
static u_int16_t
parse_length(const char *s)
{
- int len;
+ unsigned int len;
- len = string_to_number(s, 0, 0xFFFF);
-
- if (len == -1)
+ if (string_to_number(s, 0, 0xFFFF, &len) == -1)
exit_error(PARAMETER_PROBLEM, "length invalid: `%s'\n", s);
else
return (u_int16_t )len;