aboutsummaryrefslogtreecommitdiff
path: root/src/preamble.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/preamble.js')
-rw-r--r--src/preamble.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/preamble.js b/src/preamble.js
index f53f50ad..2260d08a 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -146,6 +146,11 @@ function __formatString() {
if (next == '.'.charCodeAt(0)) {
var limit = parseInt(String.fromCharCode(HEAP[textIndex+2]));
var dotIndex = argText.indexOf('.');
+ if (dotIndex == -1) {
+ dotIndex = argText.length;
+ argText += '.';
+ }
+ argText += '00000000000'; // padding
argText = argText.substr(0, dotIndex+1+limit);
textIndex += 2;
}