fix printIntDetails for 0

This commit is contained in:
Mathieu Maret 2018-11-14 15:45:34 +01:00
parent 4bbe08d8f5
commit 9b46b60b7a

View File

@ -57,6 +57,9 @@ void printIntDetails(int integer, uint color, uint bgColor, int startX, int star
if (integer < 0) { if (integer < 0) {
printCharDetails('-', color, bgColor, x++, startY); printCharDetails('-', color, bgColor, x++, startY);
} }
if (integer == 0){
num[i++] = 0;
}
while (integer != 0) { while (integer != 0) {
int digit = integer % 10; int digit = integer % 10;
num[i++] = (digit > 0) ? digit : -digit; num[i++] = (digit > 0) ? digit : -digit;