...
 
Commits (1)
......@@ -536,7 +536,7 @@ DLLEXPORT int inet_pton(int af, const char *src, void *dst)
}
hints.ai_flags = AI_NUMERICHOST|AI_PASSIVE;
if(getaddrinfo(addr_str, NULL, &hints, &res))
if(getaddrinfo(src, NULL, &hints, &res))
return -1;
for(cur = res; cur; cur++) {
......@@ -549,10 +549,10 @@ DLLEXPORT int inet_pton(int af, const char *src, void *dst)
}
switch(af) {
case AF_INET:
memcpy(dst, ((struct sockaddr_in *)(cur->sin_addr)), sizeof((struct sockaddr_in *)cur->sin_addr));
memcpy(dst, (((struct sockaddr_in *)cur)->sin_addr), sizeof(((struct sockaddr_in *)cur)->sin_addr));
break;
case AF_INET6:
memcpy(dst, ((struct sockaddr_in6 *)(cur->sin6_addr)), sizeof((struct sockaddr_in6 *)cur->sin6_addr));
memcpy(dst, (((struct sockaddr_in6 *)cur)->sin6_addr), sizeof(((struct sockaddr_in6 *)cur)->sin6_addr));
break;
}
freeaddrinfo(res);
......