summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ares_getnameinfo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ares_getnameinfo.c b/ares_getnameinfo.c
index c0d2e18..82e261d 100644
--- a/ares_getnameinfo.c
+++ b/ares_getnameinfo.c
@@ -188,7 +188,7 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
if (sa->sa_family == AF_INET)
{
niquery->family = AF_INET;
- memcpy(&niquery->addr.addr4, addr, sizeof(addr));
+ memcpy(&niquery->addr.addr4, addr, sizeof(struct in_addr));
ares_gethostbyaddr(channel, &addr->sin_addr,
sizeof(struct in_addr), AF_INET,
nameinfo_callback, niquery);
@@ -196,7 +196,7 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa,
else
{
niquery->family = AF_INET6;
- memcpy(&niquery->addr.addr6, addr6, sizeof(addr6));
+ memcpy(&niquery->addr.addr6, addr6, sizeof(struct ares_in6_addr));
ares_gethostbyaddr(channel, &addr6->sin6_addr,
sizeof(struct ares_in6_addr), AF_INET6,
nameinfo_callback, niquery);