diff options
| author | John Polstra <jdp@FreeBSD.org> | 2001-05-26 16:41:37 +0000 |
|---|---|---|
| committer | John Polstra <jdp@FreeBSD.org> | 2001-05-26 16:41:37 +0000 |
| commit | 9f85b2588ff872be1a956de057486366cfc7af13 (patch) | |
| tree | 5c6e0caa9449549ac97ed164cf15b55c792aed94 | |
| parent | 47a99cd60ccb7e30d08a279deb3953d660c0a10c (diff) | |
Notes
| -rw-r--r-- | sys/netgraph/ng_parse.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/netgraph/ng_parse.c b/sys/netgraph/ng_parse.c index 94367cba7e4b..7cd80805a4f9 100644 --- a/sys/netgraph/ng_parse.c +++ b/sys/netgraph/ng_parse.c @@ -338,7 +338,7 @@ ng_int8_parse(const struct ng_parse_type *type, char *eptr; val = strtol(s + *off, &eptr, 0); - if (val < -0x80 || val > 0xff || eptr == s + *off) + if (val < (int8_t)0x80 || val > (u_int8_t)0xff || eptr == s + *off) return (EINVAL); *off = eptr - s; val8 = (int8_t)val; @@ -431,7 +431,8 @@ ng_int16_parse(const struct ng_parse_type *type, char *eptr; val = strtol(s + *off, &eptr, 0); - if (val < -0x8000 || val > 0xffff || eptr == s + *off) + if (val < (int16_t)0x8000 + || val > (u_int16_t)0xffff || eptr == s + *off) return (EINVAL); *off = eptr - s; val16 = (int16_t)val; @@ -524,8 +525,8 @@ ng_int32_parse(const struct ng_parse_type *type, char *eptr; val = strtol(s + *off, &eptr, 0); - if (val < (long)-0x80000000 - || val > (u_long)0xffffffff || eptr == s + *off) + if (val < (int32_t)0x80000000 + || val > (u_int32_t)0xffffffff || eptr == s + *off) return (EINVAL); *off = eptr - s; val32 = (int32_t)val; |
