[Midnightbsd-cvs] src [10519] trunk/lib/libc/string/strerror.c: tweak error handling

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Jun 7 18:30:13 EDT 2018


Revision: 10519
          http://svnweb.midnightbsd.org/src/?rev=10519
Author:   laffer1
Date:     2018-06-07 18:30:12 -0400 (Thu, 07 Jun 2018)
Log Message:
-----------
tweak error handling

Modified Paths:
--------------
    trunk/lib/libc/string/strerror.c

Modified: trunk/lib/libc/string/strerror.c
===================================================================
--- trunk/lib/libc/string/strerror.c	2018-06-07 12:51:09 UTC (rev 10518)
+++ trunk/lib/libc/string/strerror.c	2018-06-07 22:30:12 UTC (rev 10519)
@@ -10,7 +10,7 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
@@ -42,6 +42,8 @@
 #include <string.h>
 #include <stdio.h>
 
+#include "errlst.h"
+
 #define	UPREFIX		"Unknown error"
 
 /*
@@ -87,7 +89,7 @@
 	catd = catopen("libc", NL_CAT_LOCALE);
 #endif
 
-	if (errnum < 0 || errnum >= sys_nerr) {
+	if (errnum < 0 || errnum >= __hidden_sys_nerr) {
 		errstr(errnum,
 #if defined(NLS)
 			catgets(catd, 1, 0xffff, UPREFIX),
@@ -99,9 +101,9 @@
 	} else {
 		if (strlcpy(strerrbuf,
 #if defined(NLS)
-			catgets(catd, 1, errnum, sys_errlist[errnum]),
+			catgets(catd, 1, errnum, __hidden_sys_errlist[errnum]),
 #else
-			sys_errlist[errnum],
+			__hidden_sys_errlist[errnum],
 #endif
 			buflen) >= buflen)
 		retval = ERANGE;



More information about the Midnightbsd-cvs mailing list