diff options
Diffstat (limited to 'stdio-common')
-rw-r--r-- | stdio-common/scanf7.c | 2 | ||||
-rw-r--r-- | stdio-common/tstdiomisc.c | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/stdio-common/scanf7.c b/stdio-common/scanf7.c index 17d0872..c746e47 100644 --- a/stdio-common/scanf7.c +++ b/stdio-common/scanf7.c @@ -16,7 +16,7 @@ main (int argc, char *argv[]) n = -2; ret = sscanf ("1000", "%llld", &n); printf ("%%llld: ret: %d, n: %Ld\n", ret, n); - if (ret != 0 || n >= 0L) + if (ret > 0 || n >= 0L) abort (); return 0; diff --git a/stdio-common/tstdiomisc.c b/stdio-common/tstdiomisc.c index 8dac4f2..e99457f 100644 --- a/stdio-common/tstdiomisc.c +++ b/stdio-common/tstdiomisc.c @@ -19,17 +19,17 @@ t2 (void) int retval; #define SCAN(INPUT, FORMAT, VAR, EXP_RES, EXP_VAL) \ VAR = -1; \ - retval = sscanf (INPUT, FORMAT, &VAR); \ + retval = sscanf (INPUT, FORMAT, &VAR); \ printf ("sscanf (\"%s\", \"%s\", &x) => %d, x = %ld\n", \ INPUT, FORMAT, retval, VAR); \ result |= retval != EXP_RES || VAR != EXP_VAL SCAN ("12345", "%ld", N, 1, 12345); - SCAN ("12345", "%llllld", N, 0, -1); - SCAN ("12345", "%LLLLLd", N, 0, -1); + SCAN ("12345", "%llllld", N, -1, -1); + SCAN ("12345", "%LLLLLd", N, -1, -1); SCAN ("test ", "%*s%n", n, 0, 4); - SCAN ("test ", "%2*s%n", n, 0, -1); - SCAN ("12 ", "%l2d", n, 0, -1); + SCAN ("test ", "%2*s%n", n, -1, -1); + SCAN ("12 ", "%l2d", n, -1, -1); SCAN ("12 ", "%2ld", N, 1, 12); return result; |