long base;
long len;
} best, cur;
- unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
+ unsigned long words[NS_IN6ADDRSZ / NS_INT16SZ];
int i;
/*
* 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));
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? */
* 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));