repo.or.cz
/
mascara-docs.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
* added compilers lcc and bcc (linux86)
[mascara-docs.git]
/
compilers
/
linux86-0.16.17
/
libc
/
misc
/
itoa.c
blob
0822cfcdf33cf5c70512aec456a8c381b6165030
1
/* itoa.c <ndf@linux.mit.edu> */
2
#define __MAX_INT_CHARS 7
3
4
char
*
5
itoa
(
i
)
6
int
i
;
7
{
8
static char
a
[
__MAX_INT_CHARS
];
9
char
*
b
=
a
+
sizeof
(
a
) -
1
;
10
int
sign
= (
i
<
0
);
11
12
if
(
sign
)
13
i
= -
i
;
14
*
b
=
0
;
15
do
16
{
17
*--
b
=
'0'
+ (
i
%
10
);
18
i
/=
10
;
19
}
20
while
(
i
);
21
if
(
sign
)
22
*--
b
=
'-'
;
23
return
b
;
24
}