diff options
author | laforge <laforge> | 2001-07-23 02:14:22 +0000 |
---|---|---|
committer | laforge <laforge> | 2001-07-23 02:14:22 +0000 |
commit | 1eef903c702ef52efcbf5e8b04117b3cec591922 (patch) | |
tree | 6b34d5dfc6bca2aff38c5e6f406c0f1700fe8836 /extensions/libip6t_tcp.c | |
parent | 24824b73d48ba0590401934597f67b0e982b900d (diff) |
further fixes of string_to_number fixes
Diffstat (limited to 'extensions/libip6t_tcp.c')
-rw-r--r-- | extensions/libip6t_tcp.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/extensions/libip6t_tcp.c b/extensions/libip6t_tcp.c index 718ec8c..dd515f0 100644 --- a/extensions/libip6t_tcp.c +++ b/extensions/libip6t_tcp.c @@ -52,9 +52,9 @@ service_to_port(const char *name) static u_int16_t parse_tcp_port(const char *port) { - int portnum; + unsigned int portnum; - if ((portnum = string_to_number(port, 0, 65535)) != -1 || + if (string_to_number(port, 0, 65535, &portnum) != -1 || (portnum = service_to_port(port)) != -1) return (u_int16_t)portnum; @@ -141,10 +141,9 @@ parse_tcp_flags(struct ip6t_tcp *tcpinfo, static void parse_tcp_option(const char *option, u_int8_t *result) { - int ret; + unsigned int ret; - ret = string_to_number(option, 1, 255); - if (ret == -1) + if (string_to_number(option, 1, 266, &ret) == -1) exit_error(PARAMETER_PROBLEM, "Bad TCP option `%s'", option); *result = (u_int8_t)ret; |