aboutsummaryrefslogtreecommitdiff
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
commit646a6b604fefbdc019d9e7ff1f1cb1f171c9dcc3 (patch)
tree2fcba6d61b750efc3a9c4a2686f4d2313dd3689d
parentcca00a63781934492caa8b46f8a9e56035a6e6fe (diff)
Minor compatibility fix
-rw-r--r--ares/inet_ntop.c8
-rw-r--r--lib/inet_ntop.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/ares/inet_ntop.c b/ares/inet_ntop.c
index 9902391d1..097e7764e 100644
--- a/ares/inet_ntop.c
+++ b/ares/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? */
diff --git a/lib/inet_ntop.c b/lib/inet_ntop.c
index b6c9716d4..3bbd9eb14 100644
--- a/lib/inet_ntop.c
+++ b/lib/inet_ntop.c
@@ -119,7 +119,7 @@ static char *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 < IN6ADDRSZ; i++)
words[i/2] |= (src[i] << ((1 - (i % 2)) << 3));