freebsd-nq/usr.bin/sgmls/sgmls/strerror.c
John Fieber 61614fe0ad The sgmls SGML parser. Support for our hypertext documents.
Reviewed by:	Paul Richards, Garrett Wollman
1995-04-27 16:03:47 +00:00

37 lines
628 B
C

/* strerror.c -
ANSI C strerror() function.
Written by James Clark (jjc@jclark.com).
*/
#include "config.h"
#ifdef STRERROR_MISSING
#include <stdio.h>
char *strerror(n)
int n;
{
extern int sys_nerr;
extern char *sys_errlist[];
static char buf[sizeof("Error ") + 1 + 3*sizeof(int)];
if (n >= 0 && n < sys_nerr && sys_errlist[n] != 0)
return sys_errlist[n];
else {
sprintf(buf, "Error %d", n);
return buf;
}
}
#endif /* STRERROR_MISSING */
/*
Local Variables:
c-indent-level: 5
c-continued-statement-offset: 5
c-brace-offset: -5
c-argdecl-indent: 0
c-label-offset: -5
End:
*/