compiler warning fix
authorYang Tse <yangsita@gmail.com>
Sat, 3 Feb 2007 13:05:28 +0000 (13:05 +0000)
committerYang Tse <yangsita@gmail.com>
Sat, 3 Feb 2007 13:05:28 +0000 (13:05 +0000)
lib/hostip4.c

index 273703d..c4c6256 100644 (file)
@@ -124,6 +124,9 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
                                 int port,
                                 int *waitp)
 {
+#if defined(HAVE_GETHOSTBYNAME_R_3) || defined(HAVE_GETHOSTBYNAME_R_6)
+  int res = ERANGE;
+#endif
   Curl_addrinfo *ai = NULL;
   struct hostent *h = NULL;
   in_addr_t in;
@@ -134,10 +137,6 @@ 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);