actual/packages/node-libofx/OpenSP-1.5.2/lib/strerror.c

24 lines
407 B
C
Raw Normal View History

2022-04-29 02:44:38 +00:00
#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