aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-01-13 15:31:00 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-01-13 15:31:52 -0800
commit7844db37f5b6dce1e7772f955ff606ef806ae032 (patch)
treee2806527be8e40b11ce83cb7de6e08915413f92c /src
parentcb0f677e53e556185951c84a472a340ab49d3dc3 (diff)
handle precision -1 in printf .*
Diffstat (limited to 'src')
-rw-r--r--src/library.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/library.js b/src/library.js
index 3f030489..6cbe7854 100644
--- a/src/library.js
+++ b/src/library.js
@@ -1950,9 +1950,9 @@ LibraryManager.library = {
}
// Handle precision.
- var precisionSet = false;
+ var precisionSet = false, precision = -1;
if (next == {{{ charCode('.') }}}) {
- var precision = 0;
+ precision = 0;
precisionSet = true;
textIndex++;
next = {{{ makeGetValue(0, 'textIndex+1', 'i8') }}};
@@ -1969,9 +1969,8 @@ LibraryManager.library = {
}
}
next = {{{ makeGetValue(0, 'textIndex+1', 'i8') }}};
- } else {
- var precision = 6; // Standard default.
}
+ if (precision === -1) precision = 6; // Standard default.
// Handle integer sizes. WARNING: These assume a 32-bit architecture!
var argSize;