|
@@ -69,11 +69,19 @@ u32 mini_itoa(int value, u32 radix, u32 uppercase, u32 unsig, char * buffer, u32
|
69
|
69
|
value = -value;
|
70
|
70
|
}
|
71
|
71
|
/* This builds the string back to front ... */
|
72
|
|
- do {
|
73
|
|
- u32 digit = value % radix;
|
74
|
|
- * (pbuffer++) = (digit < 10 ? '0' + digit : (uppercase ? 'A' : 'a') + digit - 10);
|
75
|
|
- value /= radix;
|
76
|
|
- } while (value > 0);
|
|
72
|
+ if (radix == 16) {
|
|
73
|
+ do {
|
|
74
|
+ u32 digit = value & 0xF;
|
|
75
|
+ * (pbuffer++) = (digit < 10 ? '0' + digit : (uppercase ? 'A' : 'a') + digit - 10);
|
|
76
|
+ value >>= 4;
|
|
77
|
+ } while (value > 0);
|
|
78
|
+ } else {
|
|
79
|
+ do {
|
|
80
|
+ u32 digit = value % radix;
|
|
81
|
+ * (pbuffer++) = (digit < 10 ? '0' + digit : (uppercase ? 'A' : 'a') + digit - 10);
|
|
82
|
+ value /= radix;
|
|
83
|
+ } while (value > 0);
|
|
84
|
+ }
|
77
|
85
|
for (i = (pbuffer - buffer); i < zero_pad; i++)
|
78
|
86
|
* (pbuffer++) = '0';
|
79
|
87
|
if (negative)
|