aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormanuels <manuel.schoelling@gmx.de>2013-01-14 21:39:45 +0100
committermanuels <manuel.schoelling@gmx.de>2013-01-14 21:39:45 +0100
commitf9d8e493760b1b1720a45133896fb690919b3c6d (patch)
treec3e1810ebc3b63c5713c1d8f4599c3cf4ec42a95
parentc1135eeb3547d747e61a60c0f73e7a82e87981b3 (diff)
Added floating point aliases for sscanf
-rw-r--r--src/library.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/library.js b/src/library.js
index 7ae17fb7..57468585 100644
--- a/src/library.js
+++ b/src/library.js
@@ -2515,7 +2515,7 @@ LibraryManager.library = {
var curr = 0;
var buffer = [];
// Read characters according to the format. floats are trickier, they may be in an unfloat state in the middle, then be a valid float later
- if (type == 'f') {
+ if ((type == 'f') || (type == 'e') || (type == 'g') || (type == 'E')) {
var last = 0;
next = get();
while (next > 0) {
@@ -2569,6 +2569,10 @@ LibraryManager.library = {
{{{ makeSetValue('argPtr', 0, 'parseInt(text, 16)', 'i32') }}}
break;
case 'f':
+ case 'e':
+ case 'g':
+ case 'E':
+ // fallthrough intended
if (long_) {
{{{ makeSetValue('argPtr', 0, 'parseFloat(text)', 'double') }}}
} else {