summaryrefslogtreecommitdiff
path: root/security/tcp_wrappers/patches/patch-ad
blob: 6c45c18ac0a4ba7ea083d08c9b6d8696c028e2b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$NetBSD: patch-ad,v 1.1 2004/03/21 19:49:05 bouyer Exp $

--- percent_m.c.orig	Thu Feb  5 11:40:42 2004
+++ percent_m.c	Thu Feb  5 11:44:20 2004
@@ -13,10 +13,6 @@
 #include <string.h>
 
 extern int errno;
-#ifndef SYS_ERRLIST_DEFINED
-extern char *sys_errlist[];
-extern int sys_nerr;
-#endif
 
 #include "mystdarg.h"
 
@@ -29,11 +25,7 @@
 
     while (*bp = *cp)
 	if (*cp == '%' && cp[1] == 'm') {
-	    if (errno < sys_nerr && errno > 0) {
-		strcpy(bp, sys_errlist[errno]);
-	    } else {
-		sprintf(bp, "Unknown error %d", errno);
-	    }
+	    strcpy(bp, strerror(errno));
 	    bp += strlen(bp);
 	    cp += 2;
 	} else {