Staging
v0.8.1
Revision d11f5f3eb51180c7cf55cb61ef5848fbafa03925 authored by Fred Drake on 11 July 2001, 20:40:05 UTC, committed by Fred Drake on 11 July 2001, 20:40:05 UTC
concrete sequence objects, since their API is simpler.

This is in response to a comment in SF bug #440037.

(Does this really belong in the bugfix release?  Yes: this is a readability
bug, and those are important in the documentation.)
1 parent 90e6518
Raw File
strerror.c

/* PD implementation of strerror() for systems that don't have it.
   Author: Guido van Rossum, CWI Amsterdam, Oct. 1990, <guido@cwi.nl>. */

#include <stdio.h>

extern int sys_nerr;
extern char *sys_errlist[];

char *
strerror(int err)
{
	static char buf[20];
	if (err >= 0 && err < sys_nerr)
		return sys_errlist[err];
	sprintf(buf, "Unknown errno %d", err);
	return buf;
}

#ifdef macintosh
int sys_nerr = 0;
char *sys_errlist[1] = 0;
#endif
back to top