libpayload: fix string-to-numeric functions for base > 10
[coreboot.git] / payloads / libpayload / libc / string.c
index ce5767e4b08600e97b8629639b96750cf7c05203..cc587c82a2989411a023d1a4faffe920795b1418 100644 (file)
@@ -407,7 +407,7 @@ static int _offset(char ch, int base)
         if (ch >= '0' && ch <= '9')
                 return ch - '0';
         else
-                return tolower(ch) - 'a';
+                return 10 + tolower(ch) - 'a';
 }
 
 /**