aboutsummaryrefslogtreecommitdiff
path: root/lib/inet_ntop.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2006-08-04 02:49:04 +0000
committerYang Tse <yangsita@gmail.com>2006-08-04 02:49:04 +0000
commit8f8ba9486db931aadde595c7076c371bbe24e6af (patch)
tree0de3061f1b55a38ae568f0a75a397ecd8116fc31 /lib/inet_ntop.c
parentf55924b3e04db8ca63e01c0d59aac73442843845 (diff)
Fix compiler warning
Diffstat (limited to 'lib/inet_ntop.c')
-rw-r--r--lib/inet_ntop.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/inet_ntop.c b/lib/inet_ntop.c
index c3b55c02d..b6c9716d4 100644
--- a/lib/inet_ntop.c
+++ b/lib/inet_ntop.c
@@ -106,14 +106,14 @@ static char *inet_ntop6 (const unsigned char *src, char *dst, size_t size)
* Keep this in mind if you think this function should have been coded
* to use pointer overlays. All the world's not a VAX.
*/
- char tmp [sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
+ char tmp[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
char *tp;
struct {
long base;
long len;
} best, cur;
- u_long words [IN6ADDRSZ / INT16SZ];
- int i;
+ unsigned long words[IN6ADDRSZ / INT16SZ];
+ int i;
/* Preprocess:
* Copy the input (bytewise) array into a wordwise array.
@@ -125,6 +125,9 @@ static char *inet_ntop6 (const unsigned char *src, char *dst, size_t size)
best.base = -1;
cur.base = -1;
+ best.len = 0;
+ cur.len = 0;
+
for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++)
{
if (words[i] == 0)