Commit b3d39275 authored by Yang Tse's avatar Yang Tse
Browse files

inet_pton: fix compiler warning

warning C4146: unary minus operator applied to unsigned type, result still unsigned
parent 1d75d308
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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;
  }