diff options
Diffstat (limited to 'ares/inet_net_pton.c')
-rw-r--r-- | ares/inet_net_pton.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ares/inet_net_pton.c b/ares/inet_net_pton.c index ef96741a6..8c78a0b20 100644 --- a/ares/inet_net_pton.c +++ b/ares/inet_net_pton.c @@ -252,7 +252,7 @@ getv4(const char *src, unsigned char *dst, int *bitsp) if (ch == '.' || ch == '/') { if (dst - odst > 3) /* too many octets? */ return (0); - *dst++ = val; + *dst++ = (unsigned char)val; if (ch == '/') return (getbits(src, bitsp)); val = 0; @@ -265,7 +265,7 @@ getv4(const char *src, unsigned char *dst, int *bitsp) return (0); if (dst - odst > 3) /* too many octets? */ return (0); - *dst++ = val; + *dst++ = (unsigned char)val; return (1); } @@ -321,8 +321,8 @@ inet_net_pton_ipv6(const char *src, unsigned char *dst, size_t size) goto enoent; if (tp + NS_INT16SZ > endp) return (0); - *tp++ = (unsigned char) (val >> 8) & 0xff; - *tp++ = (unsigned char) val & 0xff; + *tp++ = (unsigned char)((val >> 8) & 0xff); + *tp++ = (unsigned char)(val & 0xff); saw_xdigit = 0; digits = 0; val = 0; @@ -342,8 +342,8 @@ inet_net_pton_ipv6(const char *src, unsigned char *dst, size_t size) if (saw_xdigit) { if (tp + NS_INT16SZ > endp) goto enoent; - *tp++ = (unsigned char) (val >> 8) & 0xff; - *tp++ = (unsigned char) val & 0xff; + *tp++ = (unsigned char)((val >> 8) & 0xff); + *tp++ = (unsigned char)(val & 0xff); } if (bits == -1) bits = 128; |