Add an itoa() function, following the most common prototype I can find.
This commit is contained in:
parent
9d0f03822c
commit
1bd6a9d4fa
13
lang/cem/libcc.ansi/core/printf/itoa.c
Normal file
13
lang/cem/libcc.ansi/core/printf/itoa.c
Normal file
|
@ -0,0 +1,13 @@
|
|||
#include <stdio.h>
|
||||
|
||||
void itoa(long value, char* buffer, int radix)
|
||||
{
|
||||
if (value < 0)
|
||||
{
|
||||
*buffer++ = '-';
|
||||
value = -value;
|
||||
}
|
||||
buffer = _i_compute(value, 10, buffer, 0);
|
||||
*buffer++ = '\0';
|
||||
}
|
||||
|
|
@ -75,6 +75,7 @@ extern void perror(const char *_s);
|
|||
|
||||
/* Internal function used in several places which is approximately itoa(). */
|
||||
extern char *_i_compute(unsigned long val, int base, char *s, int nrdigits);
|
||||
extern void itoa(long val, char* buffer, int radix);
|
||||
|
||||
#if ACKCONF_WANT_EMULATED_FILE
|
||||
#include <ack/emufile.h>
|
||||
|
|
Loading…
Reference in a new issue