summaryrefslogtreecommitdiff
path: root/stdio-common/tstscanf.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common/tstscanf.c')
-rw-r--r--stdio-common/tstscanf.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/stdio-common/tstscanf.c b/stdio-common/tstscanf.c
index 4e56251e03..93f77ce2d9 100644
--- a/stdio-common/tstscanf.c
+++ b/stdio-common/tstscanf.c
@@ -265,5 +265,19 @@ main (int argc, char **argv)
}
}
+ fputs ("Test 9:\n", stdout);
+ {
+ /* From PR libc/1313 reported by Ben Caradoc-Davies <bmcd@physics.otago.ac.nz>. */
+ float value;
+ int res;
+
+ res = sscanf ("0123", "%2f", &value);
+ if (res != 1 || value != 1.0)
+ {
+ fputs ("test failed!\n", stdout);
+ result = 1;
+ }
+ }
+
exit (result);
}