From: Niels Provos Date: Tue, 24 Jun 2008 21:01:44 +0000 (+0000) Subject: fix a bug in http_connect for windows; the address was not copied correctly. X-Git-Tag: release-2.0.1-alpha~257 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f80f90ed8bcd83e41a14cf120b69b7444ffa73fa;p=libevent fix a bug in http_connect for windows; the address was not copied correctly. svn:r863 --- diff --git a/test/regress_http.c b/test/regress_http.c index c929214e..972178d2 100644 --- a/test/regress_http.c +++ b/test/regress_http.c @@ -129,7 +129,7 @@ http_connect(const char *address, u_short port) if (!(he = gethostbyname(address))) { event_warn("gethostbyname"); } - memcpy(&sin.sin_addr, &he->h_addr, sizeof(struct in_addr)); + memcpy(&sin.sin_addr, he->h_addr_list[0], he->h_length); sin.sin_family = AF_INET; sin.sin_port = htons(port); slen = sizeof(struct sockaddr_in);