Browse Source

fixed an issue in the itoa implementation for base > 10 #10

prozessorkern 5 years ago
parent
commit
8078a436e8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/shellmatta.c

+ 1 - 1
src/shellmatta.c

@@ -97,7 +97,7 @@ static uint32_t shellItoa(int32_t value, char *buffer, uint32_t base)
         do
         {
             digitValue = (char) (value % base);
-            tempBuffer[i] = (digitValue < 10u) ? ('0' + digitValue) : ('A' + digitValue);
+            tempBuffer[i] = (digitValue < 10u) ? ('0' + digitValue) : (('A' - 10) + digitValue);
             value /= base;
             i ++;
         }while(value > 0);