aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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));