diff options
Diffstat (limited to 'xtables.c')
-rw-r--r-- | xtables.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -18,6 +18,7 @@ #include <ctype.h> #include <errno.h> #include <fcntl.h> +#include <inttypes.h> #include <netdb.h> #include <stdarg.h> #include <stdbool.h> @@ -426,10 +427,10 @@ int xtables_load_ko(const char *modprobe, bool quiet) * Returns true/false whether number was accepted. On failure, *value has * undefined contents. */ -bool xtables_strtoul(const char *s, char **end, unsigned long long *value, - unsigned long min, unsigned long max) +bool xtables_strtoul(const char *s, char **end, uintmax_t *value, + uintmax_t min, uintmax_t max) { - unsigned long v; + uintmax_t v; const char *p; char *my_end; @@ -439,7 +440,7 @@ bool xtables_strtoul(const char *s, char **end, unsigned long long *value, ; if (*p == '-') return false; - v = strtoul(s, &my_end, 0); + v = strtoumax(s, &my_end, 0); if (my_end == s) return false; if (end != NULL) @@ -459,7 +460,7 @@ bool xtables_strtoul(const char *s, char **end, unsigned long long *value, bool xtables_strtoui(const char *s, char **end, unsigned int *value, unsigned int min, unsigned int max) { - unsigned long long v; + uintmax_t v; bool ret; ret = xtables_strtoul(s, end, &v, min, max); |