about summary refs log tree commit diff
path: root/stdio-common/scanf10.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common/scanf10.c')
-rw-r--r--stdio-common/scanf10.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/stdio-common/scanf10.c b/stdio-common/scanf10.c
new file mode 100644
index 0000000000..f8961378ef
--- /dev/null
+++ b/stdio-common/scanf10.c
@@ -0,0 +1,15 @@
+#include <stdio.h>
+#include <string.h>
+
+int
+main (int argc, char *argv[])
+{
+  const char teststring[] = "<tag `word'>";
+  int retc, a, b;
+
+  retc = sscanf (teststring, "<%*s `%n%*s%n'>", &a, &b);
+
+  printf ("retc=%d a=%d b=%d\n", retc, a, b);
+
+  return retc == -1 && a == 6 && b == 12 ? 0 : 1;
+}