Fix obsolete comment regarding FSM truncation.
[PostgreSQL.git] / src / port / strerror.c
blobffa4cee8480585a1eb65d7f11222d94864e64b0d
1 /* $PostgreSQL$ */
3 /*
4 * strerror - map error number to descriptive string
6 * This version is obviously somewhat Unix-specific.
8 * based on code by Henry Spencer
9 * modified for ANSI by D'Arcy J.M. Cain
12 #include "c.h"
15 extern const char *const sys_errlist[];
16 extern int sys_nerr;
18 const char *
19 strerror(int errnum)
21 static char buf[24];
23 if (errnum < 0 || errnum > sys_nerr)
25 sprintf(buf, _("unrecognized error %d"), errnum);
26 return buf;
29 return sys_errlist[errnum];