summaryrefslogtreecommitdiffstats
path: root/extensions/libip6t_icmpv6.c
diff options
context:
space:
mode:
authorlaforge <laforge>2001-07-23 02:14:22 +0000
committerlaforge <laforge>2001-07-23 02:14:22 +0000
commit1eef903c702ef52efcbf5e8b04117b3cec591922 (patch)
tree6b34d5dfc6bca2aff38c5e6f406c0f1700fe8836 /extensions/libip6t_icmpv6.c
parent24824b73d48ba0590401934597f67b0e982b900d (diff)
further fixes of string_to_number fixes
Diffstat (limited to 'extensions/libip6t_icmpv6.c')
-rw-r--r--extensions/libip6t_icmpv6.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/extensions/libip6t_icmpv6.c b/extensions/libip6t_icmpv6.c
index 41ae5ca..1b801d2 100644
--- a/extensions/libip6t_icmpv6.c
+++ b/extensions/libip6t_icmpv6.c
@@ -118,7 +118,7 @@ parse_icmpv6(const char *icmpv6type, u_int8_t *type, u_int8_t code[])
} else {
char *slash;
char buffer[strlen(icmpv6type) + 1];
- int number;
+ unsigned int number;
strcpy(buffer, icmpv6type);
slash = strchr(buffer, '/');
@@ -126,14 +126,12 @@ parse_icmpv6(const char *icmpv6type, u_int8_t *type, u_int8_t code[])
if (slash)
*slash = '\0';
- number = string_to_number(buffer, 0, 255);
- if (number == -1)
+ if (string_to_number(buffer, 0, 255, &number) == -1)
exit_error(PARAMETER_PROBLEM,
"Invalid ICMPv6 type `%s'\n", buffer);
*type = number;
if (slash) {
- number = string_to_number(slash+1, 0, 255);
- if (number == -1)
+ if (string_to_number(slash+1, 0, 255, &number) == -1)
exit_error(PARAMETER_PROBLEM,
"Invalid ICMPv6 code `%s'\n",
slash+1);