diff options
author | Rich Felker <dalias@aerifal.cx> | 2011-04-20 20:00:59 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2011-04-20 20:00:59 -0400 |
commit | d4b5d6e98160b3c76b37fef1b0581c3b9a7cd192 (patch) | |
tree | 73ccb46a6bb2c7fee4072daaf3c0450244c278d1 /src/network/__ipparse.c | |
parent | 29a15ad077bd7af683d3c838d21be1c216f22f8f (diff) | |
download | musl-d4b5d6e98160b3c76b37fef1b0581c3b9a7cd192.tar.gz musl-d4b5d6e98160b3c76b37fef1b0581c3b9a7cd192.tar.bz2 musl-d4b5d6e98160b3c76b37fef1b0581c3b9a7cd192.tar.xz musl-d4b5d6e98160b3c76b37fef1b0581c3b9a7cd192.zip |
fix bugs in ipv4 parsing
Diffstat (limited to 'src/network/__ipparse.c')
-rw-r--r-- | src/network/__ipparse.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) { |