char base_char[] = "0123456789abcdefghijklmnopqrstuvwxyz";
static char*
-__uitoa_internal(unsigned int value, char* str, int base, unsigned int* size)
+__uitoa_internal(unsigned long value, char* str, int base, unsigned int* size)
{
unsigned int ptr = 0;
do {
str[ptr] = base_char[value % base];
- value = value / base;
+ value = value / (unsigned long)base;
ptr++;
} while (value);
}
static char*
-__itoa_internal(int value, char* str, int base, unsigned int* size)
+__itoa_internal(long value, char* str, int base, unsigned int* size)
{
if (value < 0 && base == 10) {
str[0] = '-';
- unsigned int _v = (unsigned int)(-value);
+ unsigned long _v = (unsigned long)(-value);
__uitoa_internal(_v, str + 1, base, size);
} else {
__uitoa_internal(value, str, base, size);
}
char*
-itoa(int value, char* str, int base)
+itoa(long value, char* str, int base)
{
return __itoa_internal(value, str, base, NULL);
}
\ No newline at end of file