about summary refs log tree commit diff
path: root/stdio-common/tstdiomisc.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common/tstdiomisc.c')
-rw-r--r--stdio-common/tstdiomisc.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/stdio-common/tstdiomisc.c b/stdio-common/tstdiomisc.c
index e99457f510..1affac5b51 100644
--- a/stdio-common/tstdiomisc.c
+++ b/stdio-common/tstdiomisc.c
@@ -21,17 +21,24 @@ t2 (void)
   VAR = -1; \
   retval = sscanf (INPUT, FORMAT, &VAR); \
   printf ("sscanf (\"%s\", \"%s\", &x) => %d, x = %ld\n", \
-	  INPUT, FORMAT, retval, VAR); \
+	  INPUT, FORMAT, retval, (long int) VAR); \
   result |= retval != EXP_RES || VAR != EXP_VAL
 
   SCAN ("12345", "%ld", N, 1, 12345);
-  SCAN ("12345", "%llllld", N, -1, -1);
-  SCAN ("12345", "%LLLLLd", N, -1, -1);
+  SCAN ("12345", "%llllld", N, 0, -1);
+  SCAN ("12345", "%LLLLLd", N, 0, -1);
   SCAN ("test ", "%*s%n",  n, 0, 4);
-  SCAN ("test ", "%2*s%n",  n, -1, -1);
-  SCAN ("12 ",   "%l2d",  n, -1, -1);
+  SCAN ("test ", "%2*s%n",  n, 0, -1);
+  SCAN ("12 ",   "%l2d",  n, 0, -1);
   SCAN ("12 ",   "%2ld",  N, 1, 12);
 
+  n = -1;
+  N = -1;
+  retval = sscanf ("1 1", "%d %Z", &n, &N);
+  printf ("sscanf (\"1 1\", \"%%d %%Z\", &n, &N) => %d, n = %d, N = %ld\n", \
+	  retval, n, N); \
+  result |= retval != 1 || n != 1 || N != -1;
+
   return result;
 }