From c26ec47e907e3707bdc94f116c0fcb2ba10fdb8c Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 2 Feb 2007 17:16:06 +0000 Subject: compiler warning fix --- lib/hostip4.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/hostip4.c b/lib/hostip4.c index 877baa2ca..273703de5 100644 --- a/lib/hostip4.c +++ b/lib/hostip4.c @@ -134,6 +134,10 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn, *waitp = 0; /* don't wait, we act synchronously */ +#if defined(HAVE_GETHOSTBYNAME_R_3) || defined(HAVE_GETHOSTBYNAME_R_6) + int res = ERANGE; +#endif + if(1 == Curl_inet_pton(AF_INET, hostname, &in)) /* This is a dotted IP address 123.123.123.123-style */ return Curl_ip2addr(in, hostname, port); @@ -146,7 +150,6 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn, */ else { int h_errnop; - int res=ERANGE; buf = (struct hostent *)calloc(CURL_HOSTENT_SIZE, 1); if(!buf) @@ -159,7 +162,6 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn, #ifdef HAVE_GETHOSTBYNAME_R_5 /* Solaris, IRIX and more */ - (void)res; /* prevent compiler warning */ h = gethostbyname_r(hostname, (struct hostent *)buf, (char *)buf + sizeof(struct hostent), -- cgit v1.2.3