From: Yang Tse Date: Thu, 25 Nov 2010 01:20:14 +0000 (+0100) Subject: inet_pton: fix compiler warning X-Git-Tag: curl-7_21_3~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b3d39275f5f6b8e4443ea84e89348c7577680acc;p=thirdparty%2Fcurl.git inet_pton: fix compiler warning warning C4146: unary minus operator applied to unsigned type, result still unsigned --- diff --git a/lib/inet_pton.c b/lib/inet_pton.c index db4f39307b..967e30fb11 100644 --- a/lib/inet_pton.c +++ b/lib/inet_pton.c @@ -218,14 +218,14 @@ inet_pton6(const char *src, unsigned char *dst) * Since some memmove()'s erroneously fail to handle * overlapping regions, we'll do the shift by hand. */ - const size_t n = tp - colonp; - size_t i; + const ssize_t n = tp - colonp; + ssize_t i; if(tp == endp) return (0); for (i = 1; i <= n; i++) { - endp[- i] = colonp[n - i]; - colonp[n - i] = 0; + *(endp - i) = *(colonp + n - i); + *(colonp + n - i) = 0; } tp = endp; }