summaryrefslogtreecommitdiff
path: root/lib/libc/stdio
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2002-10-17 13:04:00 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2002-10-17 13:04:00 +0000
commit0145ba86d1fd8b839b112e08828d0b625ee93b40 (patch)
tree194ab0f753e999b2b5045542a5d5c537b2cd5fab /lib/libc/stdio
parent44f219ea75f8b182ab8c422e03b873b075fb672f (diff)
Notes
Diffstat (limited to 'lib/libc/stdio')
-rw-r--r--lib/libc/stdio/vfscanf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c
index 6aebd60783fc..d9d3e1c09d08 100644
--- a/lib/libc/stdio/vfscanf.c
+++ b/lib/libc/stdio/vfscanf.c
@@ -464,9 +464,11 @@ literal:
if (nconv != (size_t)-2) {
if (wctob(*wcp) != EOF &&
!ccltab[wctob(*wcp)]) {
- while (--n > 0)
+ while (n != 0) {
+ n--;
__ungetc(buf[n],
fp);
+ }
break;
}
nread += n;
@@ -562,9 +564,11 @@ literal:
*wcp = L'\0';
if (nconv != (size_t)-2) {
if (iswspace(*wcp)) {
- while (--n > 0)
+ while (n != 0) {
+ n--;
__ungetc(buf[n],
fp);
+ }
break;
}
nread += n;