]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Added xbstrerror() for late construction with error as argument
authorkostas <>
Thu, 16 Oct 1997 04:06:44 +0000 (04:06 +0000)
committerkostas <>
Thu, 16 Oct 1997 04:06:44 +0000 (04:06 +0000)
lib/util.c

index f0b38eb4329e09734814949cc9baad0585eccdb9..3398e84d178e0917a56885247c38997f9664a1d0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: util.c,v 1.30 1997/07/16 20:31:55 wessels Exp $
+ * $Id: util.c,v 1.31 1997/10/15 22:06:44 kostas Exp $
  *
  * DEBUG: 
  * AUTHOR: Harvest Derived
@@ -444,6 +444,19 @@ xstrerror(void)
     return xstrerror_buf;
 }
 
+/*
+ * xbstrerror with argument for late notification */
+
+const char *
+xbstrerror(int err)
+{
+    static char xbstrerror_buf[BUFSIZ];
+    if (err < 0 || err >= sys_nerr)
+        return ("Unknown");
+    sprintf(xbstrerror_buf, "(%d) %s", err, strerror(err));
+    return xbstrerror_buf;
+}
+
 void
 Tolower(char *q)
 {