summaryrefslogtreecommitdiff
path: root/stdio-common/tstscanf.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common/tstscanf.c')
-rw-r--r--stdio-common/tstscanf.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/stdio-common/tstscanf.c b/stdio-common/tstscanf.c
index d76d95b1b7..85be441b5b 100644
--- a/stdio-common/tstscanf.c
+++ b/stdio-common/tstscanf.c
@@ -140,5 +140,15 @@ main (int argc, char **argv)
if (out != stdout)
pclose (out);
+ fputs ("Test 3:\n", out);
+ {
+ int res, val, n;
+
+ res = sscanf ("-242", "%3o%n", &val, &n);
+ printf ("res = %d, val = %d, n = %d\n", res, val, n);
+ if (res != 1 || val != -20 || n != 3)
+ return 1;
+ }
+
exit(EXIT_SUCCESS);
}