From: kostas <> Date: Thu, 16 Oct 1997 04:06:44 +0000 (+0000) Subject: Added xbstrerror() for late construction with error as argument X-Git-Tag: SQUID_3_0_PRE1~4794 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=75cf00f4ae30251cf8c6cd3781a7f51f10f0b563;p=thirdparty%2Fsquid.git Added xbstrerror() for late construction with error as argument --- diff --git a/lib/util.c b/lib/util.c index f0b38eb432..3398e84d17 100644 --- a/lib/util.c +++ b/lib/util.c @@ -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) {