diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2009-01-27 18:14:21 +0100 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2009-01-27 23:14:29 +0100 |
commit | e917bca09924435f3fca23c01042543b1826c81e (patch) | |
tree | 4af388f40ddf885f17fa3e8fe791b3f9affd2a14 /xtables.c | |
parent | a80975497968e69b23f56bf15d346c65bec381f2 (diff) |
extensions: use UINT_MAX constants over open-coded numbers (2/2)
Use the handy constants for ranges.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'xtables.c')
-rw-r--r-- | xtables.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -260,7 +260,7 @@ u_int16_t parse_port(const char *port, const char *proto) { unsigned int portnum; - if ((string_to_number(port, 0, 65535, &portnum)) != -1 || + if (string_to_number(port, 0, UINT16_MAX, &portnum) != -1 || (portnum = service_to_port(port, proto)) != (unsigned)-1) return portnum; @@ -811,7 +811,7 @@ static struct in_addr *__numeric_to_ipaddr(const char *dotted, bool is_mask) return NULL; /* autocomplete, this is a network address */ - if (!strtonum(p, NULL, &onebyte, 0, 255)) + if (!strtonum(p, NULL, &onebyte, 0, UINT8_MAX)) return NULL; addrp[i] = onebyte; @@ -822,7 +822,7 @@ static struct in_addr *__numeric_to_ipaddr(const char *dotted, bool is_mask) } *q = '\0'; - if (!strtonum(p, NULL, &onebyte, 0, 255)) + if (!strtonum(p, NULL, &onebyte, 0, UINT8_MAX)) return NULL; addrp[i] = onebyte; @@ -830,7 +830,7 @@ static struct in_addr *__numeric_to_ipaddr(const char *dotted, bool is_mask) } /* we have checked 3 bytes, now we check the last one */ - if (!strtonum(p, NULL, &onebyte, 0, 255)) + if (!strtonum(p, NULL, &onebyte, 0, UINT8_MAX)) return NULL; addrp[3] = onebyte; |