fix regression in inet_aton due to misinterpretation of __ipparse return
[musl] / src / network / inet_legacy.c
index 9907c54..0a0ad6f 100644 (file)
@@ -10,7 +10,10 @@ in_addr_t inet_network(const char *p)
 
 int inet_aton(const char *cp, struct in_addr *inp)
 {
-       return inet_pton(AF_INET, cp, (void *)inp) > 0;
+       struct sockaddr_in sin;
+       if (__ipparse(&sin, AF_INET, cp) < 0) return 0;
+       *inp = sin.sin_addr;
+       return 1;
 }
 
 struct in_addr inet_makeaddr(int net, int host)