actual/packages/node-libofx/OpenSP-1.5.2/lib/strerror.c
2022-04-28 22:44:38 -04:00

23 lines
407 B
C

#include "config.h"
#include <stdio.h>
#ifndef HAVE_STRERROR
#define INT_DIGITS 19 /* enough for 64 bit integer */
extern int sys_nerr;
extern char *sys_errlist[];
char *strerror(n)
int n;
{
static char buf[sizeof("Error ") + 1 + INT_DIGITS];
if (n >= 0 && n < sys_nerr && sys_errlist[n] != 0)
return sys_errlist[n];
else {
sprintf(buf, "Error %d", n);
return buf;
}
}
#endif