summaryrefslogtreecommitdiff
path: root/inet_net_pton.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-02-01 01:42:13 (GMT)
committerYang Tse <yangsita@gmail.com>2007-02-01 01:42:13 (GMT)
commitfb38ee15e249e187ffcbb91df82684a61783945c (patch)
treee2fb7c8f7cdb6efbd69bac999aaea5f0af08ecc0 /inet_net_pton.c
parent4a30753b47510fd84a2189cf02ea0a53ea7f1f2d (diff)
downloadc-ares-fb38ee15e249e187ffcbb91df82684a61783945c.zip
c-ares-fb38ee15e249e187ffcbb91df82684a61783945c.tar.gz
c-ares-fb38ee15e249e187ffcbb91df82684a61783945c.tar.bz2
compiler warning fix
Diffstat (limited to 'inet_net_pton.c')
-rw-r--r--inet_net_pton.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/inet_net_pton.c b/inet_net_pton.c
index ef96741..8c78a0b 100644
--- a/inet_net_pton.c
+++ b/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;