about summary refs log tree commit diff
path: root/REORG.TODO/stdio-common/bug9.c
diff options
context:
space:
mode:
Diffstat (limited to 'REORG.TODO/stdio-common/bug9.c')
-rw-r--r--REORG.TODO/stdio-common/bug9.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/REORG.TODO/stdio-common/bug9.c b/REORG.TODO/stdio-common/bug9.c
new file mode 100644
index 0000000000..732904d731
--- /dev/null
+++ b/REORG.TODO/stdio-common/bug9.c
@@ -0,0 +1,22 @@
+#include <stdio.h>
+#include <string.h>
+
+int
+main(int argc, char *argv[])
+{
+  char buf[100];
+  int a, b;
+  int status = 0;
+
+  sscanf ("12ab", "%dab%n", &a, &b);
+  sprintf (buf, "%d, %d", a, b);
+  puts (buf);
+  status |= strcmp (buf, "12, 4");
+
+  sscanf ("12ab100", "%dab%n100", &a, &b);
+  sprintf (buf, "%d, %d", a, b);
+  puts (buf);
+  status |= strcmp (buf, "12, 4");
+
+  return status;
+}