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/bug8.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 stdio-common/bug8.c (limited to 'stdio-common/bug8.c') diff --git a/stdio-common/bug8.c b/stdio-common/bug8.c new file mode 100644 index 0000000000..39a41855de --- /dev/null +++ b/stdio-common/bug8.c @@ -0,0 +1,26 @@ +#include +#include + +main() +{ + char buf[100]; + int point, x, y; + int status = 0; + + sscanf("0x10 10", "%x %x", &x, &y); + sprintf(buf, "%d %d", x, y); + puts (buf); + status |= strcmp (buf, "16 16"); + sscanf("P012349876", "P%1d%4d%4d", &point, &x, &y); + sprintf(buf, "%d %d %d", point, x, y); + status |= strcmp (buf, "0 1234 9876"); + puts (buf); + sscanf("P112349876", "P%1d%4d%4d", &point, &x, &y); + sprintf(buf, "%d %d %d", point, x, y); + status |= strcmp (buf, "1 1234 9876"); + puts (buf); + + puts (status ? "Test failed" : "Test passed"); + + return status; +} -- cgit v1.2.3