summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2006-08-04 17:35:05 +0000
committerYang Tse <yangsita@gmail.com>2006-08-04 17:35:05 +0000
commitfc71973aa6c9059742d0ed689d299d42e88b3ce0 (patch)
tree4f202c154bfca4347e00f858e0cca0fc8cf97f76
parent415e2ae109b84320ed43c76cb3f88f989db575c3 (diff)
downloadc-ares-fc71973aa6c9059742d0ed689d299d42e88b3ce0.tar.gz
c-ares-fc71973aa6c9059742d0ed689d299d42e88b3ce0.tar.bz2
c-ares-fc71973aa6c9059742d0ed689d299d42e88b3ce0.zip
Minor compatibility fix
-rw-r--r--inet_ntop.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/inet_ntop.c b/inet_ntop.c
index 9902391..097e776 100644
--- a/inet_ntop.c
+++ b/inet_ntop.c
@@ -135,7 +135,7 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
long base;
long len;
} best, cur;
- unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
+ unsigned long words[NS_IN6ADDRSZ / NS_INT16SZ];
int i;
/*
@@ -143,7 +143,7 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
* Copy the input (bytewise) array into a wordwise array.
* Find the longest run of 0x00's in src[] for :: shorthanding.
*/
- memset(words, '\0', sizeof words);
+ memset(words, '\0', sizeof(words));
for (i = 0; i < NS_IN6ADDRSZ; i++)
words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));
@@ -200,12 +200,12 @@ inet_ntop6(const unsigned char *src, char *dst, size_t size)
if (i == 6 && best.base == 0 &&
(best.len == 6 || (best.len == 5 && words[5] == 0xffff)))
{
- if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
+ if (!inet_ntop4(src+12, tp, sizeof(tmp) - (tp - tmp)))
return (NULL);
tp += strlen(tp);
break;
}
- tp += SPRINTF((tp, "%x", words[i]));
+ tp += SPRINTF((tp, "%lx", words[i]));
}
/* Was it a trailing run of 0x00's? */