diff options
author | tjr <tjr@FreeBSD.org> | 2002-10-17 12:06:29 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-10-17 12:06:29 +0000 |
commit | fa470876dd62f5c014c2abdcabcb591f02d8f6ec (patch) | |
tree | 79b74dfec43cb4526e36baad56538655b1ed9b0b /lib | |
parent | 235c4480d371a766f57bdeb52c90b856089e4e55 (diff) | |
download | FreeBSD-src-fa470876dd62f5c014c2abdcabcb591f02d8f6ec.zip FreeBSD-src-fa470876dd62f5c014c2abdcabcb591f02d8f6ec.tar.gz |
Make part of the previous change clearer; check flags for SUPPRESS directly
instead of checking whether we're using a temporary buffer.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/stdio/vfscanf.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/libc/stdio/vfscanf.c b/lib/libc/stdio/vfscanf.c index 977bfc9..6aebd60 100644 --- a/lib/libc/stdio/vfscanf.c +++ b/lib/libc/stdio/vfscanf.c @@ -379,12 +379,12 @@ literal: fp->_flags |= __SERR; goto input_failure; } - if (nconv == 0 && wcp != NULL) + if (nconv == 0 && !(flags & SUPPRESS)) *wcp = L'\0'; if (nconv != (size_t)-2) { nread += n; width--; - if (wcp != NULL) + if (!(flags & SUPPRESS)) wcp++; n = 0; } @@ -396,7 +396,7 @@ literal: break; } } - if (wcp != NULL) + if (!(flags & SUPPRESS)) nassigned++; } else if (flags & SUPPRESS) { size_t sum = 0; @@ -471,7 +471,7 @@ literal: } nread += n; width--; - if (wcp != &twc) + if (!(flags & SUPPRESS)) wcp++; nchars++; n = 0; @@ -491,7 +491,7 @@ literal: n = nchars; if (n == 0) goto match_failure; - if (wcp != &twc) { + if (!(flags & SUPPRESS)) { *wcp = L'\0'; nassigned++; } @@ -569,7 +569,7 @@ literal: } nread += n; width--; - if (wcp != &twc) + if (!(flags & SUPPRESS)) wcp++; n = 0; } @@ -581,7 +581,7 @@ literal: break; } } - if (wcp != &twc) { + if (!(flags & SUPPRESS)) { *wcp = L'\0'; nassigned++; } |