inet_pton: fix compiler warning

warning C4146: unary minus operator applied to unsigned type, result still unsigned
This commit is contained in:
Yang Tse 2010-11-25 02:20:14 +01:00
parent 1d75d30816
commit b3d39275f5

View File

@ -218,14 +218,14 @@ inet_pton6(const char *src, unsigned char *dst)
* Since some memmove()'s erroneously fail to handle * Since some memmove()'s erroneously fail to handle
* overlapping regions, we'll do the shift by hand. * overlapping regions, we'll do the shift by hand.
*/ */
const size_t n = tp - colonp; const ssize_t n = tp - colonp;
size_t i; ssize_t i;
if(tp == endp) if(tp == endp)
return (0); return (0);
for (i = 1; i <= n; i++) { for (i = 1; i <= n; i++) {
endp[- i] = colonp[n - i]; *(endp - i) = *(colonp + n - i);
colonp[n - i] = 0; *(colonp + n - i) = 0;
} }
tp = endp; tp = endp;
} }