--- a/connection.c
+++ b/connection.c
@@ -29,7 +29,7 @@
return -1;
}
sock.sin_family = hs->h_addrtype;
- memcpy (&sock.sin_addr.s_addr, hs->h_addr, hs->h_length);
+ memcpy (&sock.sin_addr.s_addr, hs->h_addr_list[0], hs->h_length);
}
if ((sockfd = socket (AF_INET, SOCK_STREAM, 0)) < 0) {