summary refs log tree commit diff
path: root/stdio-common/tstscanf.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common/tstscanf.c')
-rw-r--r--stdio-common/tstscanf.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/stdio-common/tstscanf.c b/stdio-common/tstscanf.c
index 3e6e496e4f..52473cdd8f 100644
--- a/stdio-common/tstscanf.c
+++ b/stdio-common/tstscanf.c
@@ -219,5 +219,21 @@ main (int argc, char **argv)
       }
   }
 
+  fputs ("Test 6:\n", stdout);
+  {
+    char *p = (char *) -1;
+    int res;
+
+    sprintf (buf, "%p", NULL);
+    res = sscanf (buf, "%p", &p);
+    printf ("sscanf (\"%s\", \"%%p\", &p) = %d, p == %p\n", buf, res, p);
+
+    if (res != 1 || p != NULL)
+      {
+	fputs ("test failed!\n", stdout);
+	result = 1;
+      }
+  }
+
   exit (result);
 }