diff options
Diffstat (limited to 'src/library.js')
-rw-r--r-- | src/library.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/library.js b/src/library.js index 45187d8d..51921541 100644 --- a/src/library.js +++ b/src/library.js @@ -2638,7 +2638,7 @@ LibraryManager.library = { } return fields; }, - // Performs prtinf-style formatting. + // Performs printf-style formatting. // format: A pointer to the format string. // varargs: A pointer to the start of the arguments list. // Returns the resulting string string as a character array. @@ -2821,7 +2821,9 @@ LibraryManager.library = { } else if (next == {{{ charCode('x') }}} || next == {{{ charCode('X') }}}) { prefix = flagAlternative ? '0x' : ''; #if PRECISE_I64_MATH - if (argSize == 8 && i64Math) argText = (origArg[1]>>>0).toString(16) + (origArg[0]>>>0).toString(16); else + if (argSize == 8 && i64Math) { + argText = (origArg[1] ? (origArg[1]>>>0).toString(16) : '') + (origArg[0]>>>0).toString(16); + } else #endif if (currArg < 0) { // Represent negative numbers in hex as 2's complement. |