]> arthur.barton.de Git - ngircd-alex.git/blob - src/portab/strerror.c
Make vsnprintf() portab function more portable
[ngircd-alex.git] / src / portab / strerror.c
1 /*
2  * ngIRCd -- The Next Generation IRC Daemon
3  */
4
5 #include "portab.h"
6
7 /**
8  * @file
9  * strerr() implementation
10  * https://lists.mindrot.org/pipermail/openssh-unix-dev/2000-February/000759.html
11  */
12
13 #ifndef HAVE_STRERROR
14
15 extern int   sys_nerr;
16 extern char *sys_errlist[];
17
18 GLOBAL char *
19 strerror(int e)
20 {
21         return (e >= 0 && e < sys_nerr)
22                 ? sys_errlist[e]
23                 : "unlisted error";
24 }
25
26 #endif