aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-04-16 21:19:28 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-04-16 21:19:28 -0700
commit396cb4f707dfab0a38edc40b430b441da353ffbb (patch)
treed3318b3da155d2079cb57c1c1e7010e3e9aa146b /src
parentb7015676a448b95999120d91ceaa2f2d21aeb0eb (diff)
fix sscanf handling of ends of %s
Diffstat (limited to 'src')
-rw-r--r--src/library.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library.js b/src/library.js
index b468f3f1..3dbf738d 100644
--- a/src/library.js
+++ b/src/library.js
@@ -2294,7 +2294,7 @@ LibraryManager.library = {
(type === 'x' && (next >= '0'.charCodeAt(0) && next <= '9'.charCodeAt(0) ||
next >= 'a'.charCodeAt(0) && next <= 'f'.charCodeAt(0) ||
next >= 'A'.charCodeAt(0) && next <= 'F'.charCodeAt(0))) ||
- (type === 's') &&
+ (type === 's' && (next != ' '.charCodeAt(0) && next != '\t'.charCodeAt(0) && next != '\n'.charCodeAt(0))) &&
(formatIndex >= format.length || next !== format[formatIndex].charCodeAt(0))) { // Stop when we read something that is coming up
buffer.push(String.fromCharCode(next));
next = get();