aboutsummaryrefslogtreecommitdiff
path: root/stdio-common/bug8.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-12-15 05:22:35 +0000
committerRoland McGrath <roland@gnu.org>1995-12-15 05:22:35 +0000
commit05be689b5734fb12b3e2f99bc6cb5db53da974fd (patch)
treea092c63ac633171a19ed589a7d69b80ba6fe0807 /stdio-common/bug8.c
parentfaf92f2a62ec5e48fac87a6ced0edfcaeb026459 (diff)
downloadglibc-05be689b5734fb12b3e2f99bc6cb5db53da974fd.zip
glibc-05be689b5734fb12b3e2f99bc6cb5db53da974fd.tar.gz
glibc-05be689b5734fb12b3e2f99bc6cb5db53da974fd.tar.bz2
Fri Dec 15 04:41:22 1995 Ulrich Drepper <drepper@gnu.ai.mit.edu>cvs/libc-951215
* 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 <drepper@gnu.ai.mit.edu> * 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 <hjl@nynexst.com> * stdio-common/vfscanf.c: Always check width !=0. Correctly handle %%.
Diffstat (limited to 'stdio-common/bug8.c')
-rw-r--r--stdio-common/bug8.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/stdio-common/bug8.c b/stdio-common/bug8.c
new file mode 100644
index 0000000..39a4185
--- /dev/null
+++ b/stdio-common/bug8.c
@@ -0,0 +1,26 @@
+#include <stdio.h>
+#include <string.h>
+
+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;
+}