]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bugzilla #244: Remove reference to sys_nerr
authorhno <>
Sat, 6 Apr 2002 20:57:11 +0000 (20:57 +0000)
committerhno <>
Sat, 6 Apr 2002 20:57:11 +0000 (20:57 +0000)
Patch by Allen Wittenauer / SUN.

lib/util.c

index a2d6b6936f7fa967dbf971e88af06d836c25e735..3e79dec5729623eab7cf38fe885fa51f27409cff 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: util.c,v 1.84 2002/04/06 08:49:26 adrian Exp $
+ * $Id: util.c,v 1.85 2002/04/06 13:57:11 hno Exp $
  *
  * DEBUG: 
  * AUTHOR: Harvest Derived
@@ -630,10 +630,14 @@ const char *
 xstrerror(void)
 {
     static char xstrerror_buf[BUFSIZ];
-    if (errno < 0 || errno >= sys_nerr)
-       snprintf(xstrerror_buf, BUFSIZ, "(%d) Unknown", errno);
+    static char strerror_buf[BUFSIZ];
+
+    snprintf(strerror_buf, BUFSIZ, "%s", strerror(errno));
+   
+    if (strerror_buf) 
+       snprintf(xstrerror_buf, BUFSIZ, "(%d) %s", errno, strerror_buf);
     else
-       snprintf(xstrerror_buf, BUFSIZ, "(%d) %s", errno, strerror(errno));
+        snprintf(xstrerror_buf, BUFSIZ, "(%d) Unknown", errno); 
     return xstrerror_buf;
 }