struct hostent has no longer a member h_addr
authorMarkus Bröker <mbroeker@largo.dyndns.tv>
Thu, 16 Apr 2009 12:51:15 +0200
changeset 84 f59d8a8e786f
parent 83 220d76d0d672
child 85 9568a180fc43
struct hostent has no longer a member h_addr Current netdb.h lacks support for the old h_addr pointer without special USE_GNU defines... committer: Markus Bröker <mbroeker@largo.homelinux.org>
connection.c
--- 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) {