Adding upstream version 3.86+dfsg.
[syslinux-debian/hramrach.git] / com32 / lib / strerror.c
blob8dbe74ad13118b17052e930d102b02b1e05c572a
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);