diff --git a/dom/tools/IdlScanner.cpp b/dom/tools/IdlScanner.cpp index 78d3040ead4f..6ad9ac23e31c 100644 --- a/dom/tools/IdlScanner.cpp +++ b/dom/tools/IdlScanner.cpp @@ -1131,12 +1131,16 @@ void IdlScanner::Number(int aStartChar, Token *aToken) if (isdigit(aStartChar)) { digit = aStartChar - '0'; } - else { + else if ((aStartChar >= 'a') && (aStartChar <= 'f')) { digit = 10 + (aStartChar - 'a'); } + else if ((aStartChar >= 'A') && (aStartChar <= 'F')) { + digit = 10 + (aStartChar - 'A'); + } + value = value * base + digit; aStartChar = mInputFile->get(); - } while ((' ' != aStartChar) && ('.' != aStartChar)); + } while (isdigit(aStartChar) || ((aStartChar >= 'a') && (aStartChar <= 'f')) || ((aStartChar >= 'A') && (aStartChar <= 'F'))); if (aStartChar == '.') { // double. Deal with it later