]> granicus.if.org Git - curl/commitdiff
compiler warning fix
authorYang Tse <yangsita@gmail.com>
Sat, 17 Feb 2007 11:34:33 +0000 (11:34 +0000)
committerYang Tse <yangsita@gmail.com>
Sat, 17 Feb 2007 11:34:33 +0000 (11:34 +0000)
ares/ares_gethostbyaddr.c
ares/ares_search.c

index 6c80eb941f603c06ba68622397e992b9be124660..777d2f7a065954a233ce9bbda03ddba244588c72 100644 (file)
@@ -188,6 +188,7 @@ static int file_lookup(union ares_addr *addr, int family, struct hostent **host)
   int status;
 
 #ifdef WIN32
+  int error;
   char PATH_HOSTS[MAX_PATH];
   if (IS_NT()) {
     char tmp[MAX_PATH];
@@ -216,8 +217,6 @@ static int file_lookup(union ares_addr *addr, int family, struct hostent **host)
     return ARES_ENOTFOUND;
 #endif
 
-  int error;
-
   fp = fopen(PATH_HOSTS, "r");
   if (!fp)
     {
@@ -226,7 +225,6 @@ static int file_lookup(union ares_addr *addr, int family, struct hostent **host)
         {
         case ENOENT:
           return ARES_ENOTFOUND;
-          break;
         default:
           DEBUGF(fprintf(stderr, "fopen() failed with error: %d %s\n",
                          error, strerror(error)));
index e63afff0527e8d2fc5bd19889a94d5790e8e8618..4b898a77f9e014db589b5a2553c63a273d087f1f 100644 (file)
@@ -20,6 +20,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
+#include <errno.h>
 
 #if defined(WIN32) && !defined(WATT32)
 #include "nameser.h"