chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
62705553a6d000df790d183f2208c2827a1c1708
[elogind.git]
/
klibc
/
klibc
/
strerror.c
1
/*
2
* strerror.c
3
*/
4
5
#include <string.h>
6
7
char *strerror(int errnum)
8
{
9
static char message[32] = "error "; /* enough for error 2^63-1 */
10
11
char numbuf[32];
12
char *p;
13
14
p = numbuf+sizeof numbuf;
15
*--p = '\0';
16
17
do {
18
*--p = (errnum % 10) + '0';
19
errnum /= 10;
20
} while ( errnum );
21
22
return (char *)memcpy(message+6, p, (numbuf+sizeof numbuf)-p);
23
}
24