Adding upstream version 3.50~pre5.
[syslinux-debian/hramrach.git] / com32 / lib / strerror.c
blob5d3fc9a314e8e1d1b9c10d32523af63a582f74ca
1 /*
2 * strerror.c
3 */
5 #include <string.h>
7 char *strerror(int errnum)
9 static char message[32] = "error "; /* enough for error 2^63-1 */
11 char numbuf[32];
12 char *p;
14 p = numbuf+sizeof numbuf;
15 *--p = '\0';
17 do {
18 *--p = (errnum % 10) + '0';
19 errnum /= 10;
20 } while ( errnum );
22 return (char *)memcpy(message+6, p, (numbuf+sizeof numbuf)-p);