From 05be689b5734fb12b3e2f99bc6cb5db53da974fd Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 15 Dec 1995 05:22:35 +0000 Subject: Fri Dec 15 04:41:22 1995 Ulrich Drepper * stdio-common/Makefile (tests): Add bug10. * stdio-common/bug10.c: New file. From HJ Lu. * stdio-common/tstdiomisc.c: Make more test-suite like: exit status tells about successful run. * stdio-common/vfscanf.c [!USE_IN_LIBIO]: Use `flags' to check format correctness. Correct handling of trailing white spaces in format + EOF. Fri Dec 15 01:31:56 1995 Ulrich Drepper * stdio-common/Makefile (tests): Add bug8 and bug9. * stdio-common/bug8.c, stdio-common/bug9.c: New tests. * stdio-common/vfscanf.c: Fix bug in dynamic buffer handling. * stdlib/strtod.c: Correct spelling: nominator -> numerator. Thanks to Jim Meyering. Sat Nov 25 06:05:12 1995 H.J. Lu * stdio-common/vfscanf.c: Always check width !=0. Correctly handle %%. --- stdio-common/bug10.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 stdio-common/bug10.c (limited to 'stdio-common/bug10.c') diff --git a/stdio-common/bug10.c b/stdio-common/bug10.c new file mode 100644 index 0000000..3e1477d --- /dev/null +++ b/stdio-common/bug10.c @@ -0,0 +1,26 @@ +#include +int main(int arc, char *argv) +{ + int n, res; + unsigned int val; + char *s; + int result = 0; + + s = "111"; + + n = 0; + res = sscanf(s, "%u %n", &val, &n); + + printf("Result of sscanf = %d\n", res); + printf("Scanned format %%u = %u\n", val); + printf("Possibly scanned format %%n = %d\n", n); + result |= res != 1 || val != 111 || n != 3; + + + result |= sscanf ("", " %n", &n) == EOF; + + puts (result ? "Test failed" : "All tests passed"); + + return result; +} + -- cgit v1.1