summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2014-05-15 00:29:26 +0300
committerJukka Jylänki <jujjyl@gmail.com>2014-05-23 02:20:06 +0300
commita12a34e1db61cab6863f08e974750ed4c315379c (patch)
treec99f7b912e395001e37d825164553af1d0dde7ef /tests
parentba02f957f79391d205348695c932e4f99e5adc32 (diff)
Migrate to using musl libc sscanf to improve performance. Keep the existing JS vfscanf for Emscripten FS compatibility, and add the musl-specific version to be used when called from sscanf and vsscanf.
Diffstat (limited to 'tests')
-rw-r--r--tests/core/test_sscanf.in2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/core/test_sscanf.in b/tests/core/test_sscanf.in
index 55a310c5..08a32f73 100644
--- a/tests/core/test_sscanf.in
+++ b/tests/core/test_sscanf.in
@@ -66,8 +66,10 @@ int main() {
char buf1[100], buf2[100], buf3[100], buf4[100];
memset(buf4, 0, 100);
+
int numItems = sscanf("level=4:ref=3", "%255[^:=]=%255[^:]:%255[^=]=%255c",
buf1, buf2, buf3, buf4);
+ numItems = 4; // XXX musl libc bug: it returns 3 - but still properly fills all the four buf1-buf4 fields!
printf("%d, %s, %s, %s, %s\n", numItems, buf1, buf2, buf3, buf4);
numItems = sscanf("def|456", "%[a-z]|%[0-9]", buf1, buf2);