ares_inet_ntop.3: s/socklen_t/ares_socklen_t
[platform/upstream/c-ares.git] / ares_strerror.c
index f994fc3..c3ecbd7 100644 (file)
@@ -1,3 +1,4 @@
+
 /* Copyright 1998 by the Massachusetts Institute of Technology.
  *
  * Permission to use, copy, modify, and distribute this
@@ -13,6 +14,7 @@
  * without express or implied warranty.
  */
 
+#include "ares_setup.h"
 #include <assert.h>
 #include "ares.h"
 
@@ -35,11 +37,20 @@ const char *ares_strerror(int code)
     "Timeout while contacting DNS servers",
     "End of file",
     "Error reading file",
-    "Out of memory"
+    "Out of memory",
     "Channel is being destroyed",
-    "Misformatted string"
+    "Misformatted string",
+    "Illegal flags specified",
+    "Given hostname is not numeric",
+    "Illegal hints flags specified",
+    "c-ares library initialization not yet performed",
+    "Error loading iphlpapi.dll",
+    "Could not find GetNetworkParams function",
+    "DNS query cancelled"
   };
 
-  assert(code >= 0 && code < (int)(sizeof(errtext) / sizeof(*errtext)));
-  return errtext[code];
+  if(code >= 0 && code < (int)(sizeof(errtext) / sizeof(*errtext)))
+    return errtext[code];
+  else
+    return "unknown";
 }