From: Rich Felker Date: Thu, 21 Apr 2011 00:00:59 +0000 (-0400) Subject: fix bugs in ipv4 parsing X-Git-Tag: v0.7.9~12 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d4b5d6e98160b3c76b37fef1b0581c3b9a7cd192;p=oweals%2Fmusl.git fix bugs in ipv4 parsing --- diff --git a/src/network/__ipparse.c b/src/network/__ipparse.c index ca9e5890..604bdc2f 100644 --- a/src/network/__ipparse.c +++ b/src/network/__ipparse.c @@ -14,9 +14,10 @@ int __ipparse(void *dest, int family, const char *s) if (family == AF_INET6) goto not_v4; - for (i=0; i<4 && *s; i++) { + for (i=0; i<4; i++) { a[i] = strtoul(s, (char **)&z, 0); if (z==s || (*z && *z != '.')) goto not_v4; + if (!*z) break; s=z+1; } switch (i) {