kolibrios/contrib/kolibri-libc/source/stdlib/itoa.c
Magomed Kostoev (mkostoevr) 1f4d74f500 Relocate kolibri-libc from GitHub
git-svn-id: svn://kolibrios.org@8622 a494cfbc-eb01-0410-851d-a64ba20cac60
2021-03-02 17:58:11 +00:00

20 lines
339 B
C

#include <string.h>
/*
char* itoa(int n, char* s)
{
int sign;
char *ptr;
ptr = s;
if(n == (int)0x80000000)
return strcpy(s, "-2147483648"); // overflowed -n
if ((sign = n) < 0) n = -n;
do {
*ptr++ = n % 10 + '0';
} while ((n = n / 10) > 0);
if (sign < 0) *ptr++ = '-';
*ptr = '\0';
return strrev(s);
}
*/