diff options
Diffstat (limited to 'libio')
-rw-r--r-- | libio/bug-rewind.c | 10 | ||||
-rw-r--r-- | libio/bug-rewind2.c | 5 |
2 files changed, 15 insertions, 0 deletions
diff --git a/libio/bug-rewind.c b/libio/bug-rewind.c index 4f8242d..1734de2 100644 --- a/libio/bug-rewind.c +++ b/libio/bug-rewind.c @@ -52,9 +52,19 @@ do_test (void) rewind (fptr); ret1 = fwscanf (fptr, L"%c%c", &arg1, &arg2); + if (ret1 != 2) + { + printf ("first fwscanf returned %d, expected 2\n", ret1); + return 3; + } rewind (fptr); ret2 = fwscanf (fptr, L"%c%n%c", &arg1, &num, &arg2); + if (ret2 != 2) + { + printf ("second fwscanf returned %d, expected 2\n", ret2); + return 4; + } if (arg2 != 'd') { diff --git a/libio/bug-rewind2.c b/libio/bug-rewind2.c index 51b5744..496f628 100644 --- a/libio/bug-rewind2.c +++ b/libio/bug-rewind2.c @@ -45,6 +45,11 @@ do_test (void) rewind (fp); ret = fwscanf (fp, L"%c", dummy); + if (ret != 1) + { + printf ("fwscanf returned %d, expected 1\n", ret); + result = 1; + } printf ("current pos = %ld\n", ftell (fp)); if (ftell (fp) != 1) |