]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Windows: sys_nerr is not available on MinGW.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Sun, 7 Aug 2011 09:56:35 +0000 (21:56 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 7 Aug 2011 09:56:35 +0000 (21:56 +1200)
compat/xstrerror.cc

index eae455adcdbeaa92cc1251dd60b5497cab460dd3..f496a327f2a9f8ff4b5f0e171763c4f906367cc3 100644 (file)
@@ -83,13 +83,11 @@ xstrerr(int error)
 
 #if _SQUID_WINDOWS_
     // Description of WSAGetLastError()
-    if (error < 0 || error >= sys_nerr) {
-        for (size_t i = 0;i < sizeof(_wsaerrtext) / sizeof(struct _wsaerrtext); i++) {
-            if (_wsaerrtext[i].err == error) {
-                // small optimization, save using a temporary buffer and two copies...
-                snprintf(xstrerror_buf, BUFSIZ, "(%d) %s, %s", error, _wsaerrtext[i].errconst, _wsaerrtext[i].errdesc);
-                return xstrerror_buf;
-            }
+    for (size_t i = 0;i < sizeof(_wsaerrtext) / sizeof(struct _wsaerrtext); i++) {
+        if (_wsaerrtext[i].err == error) {
+            // small optimization, save using a temporary buffer and two copies...
+            snprintf(xstrerror_buf, BUFSIZ, "(%d) %s, %s", error, _wsaerrtext[i].errconst, _wsaerrtext[i].errdesc);
+            return xstrerror_buf;
         }
     }
 #endif