diff --git a/dom/tools/IdlScanner.cpp b/dom/tools/IdlScanner.cpp index 3d58827414e..78d3040ead4 100644 --- a/dom/tools/IdlScanner.cpp +++ b/dom/tools/IdlScanner.cpp @@ -1127,9 +1127,16 @@ void IdlScanner::Number(int aStartChar, Token *aToken) } do { - value = value * base + (aStartChar - '0'); + long digit; + if (isdigit(aStartChar)) { + digit = aStartChar - '0'; + } + else { + digit = 10 + (aStartChar - 'a'); + } + value = value * base + digit; aStartChar = mInputFile->get(); - } while (isdigit(aStartChar)); + } while ((' ' != aStartChar) && ('.' != aStartChar)); if (aStartChar == '.') { // double. Deal with it later