diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2004-10-04 17:51:50 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2004-10-04 17:51:50 +0000 |
commit | 3ea9de7644c3110f6f8394501cd26a38852c95e9 (patch) | |
tree | 727eabbfae37c3aa5325e6e81136653f1037acfd /newlib/libc/stdio/vfscanf.c | |
parent | 298cac75d584b02beb1313b0f60f72a54064b6e5 (diff) | |
download | cygnal-3ea9de7644c3110f6f8394501cd26a38852c95e9.tar.gz cygnal-3ea9de7644c3110f6f8394501cd26a38852c95e9.tar.bz2 cygnal-3ea9de7644c3110f6f8394501cd26a38852c95e9.zip |
2004-10-04 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/vfscanf.c (__svfscanf_r): For int conversions,
count skipped zero characters as part of the nread count for %n.
* libc/machine/powerpc/vfscanf.c: Ditto.
Diffstat (limited to 'newlib/libc/stdio/vfscanf.c')
-rw-r--r-- | newlib/libc/stdio/vfscanf.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/newlib/libc/stdio/vfscanf.c b/newlib/libc/stdio/vfscanf.c index 76561fe4a..f13181af7 100644 --- a/newlib/libc/stdio/vfscanf.c +++ b/newlib/libc/stdio/vfscanf.c @@ -765,6 +765,7 @@ _DEFUN(__svfscanf_r, (rptr, fp, fmt0, ap), { /* scan an integer as if by strtol/strtoul */ unsigned width_left = 0; + int skips = 0; #ifdef hardway if (width == 0 || width > sizeof (buf) - 1) #else @@ -813,6 +814,7 @@ _DEFUN(__svfscanf_r, (rptr, fp, fmt0, ap), width_left--; width++; } + ++skips; goto skip; /* 1 through 7 always legal */ @@ -957,7 +959,7 @@ _DEFUN(__svfscanf_r, (rptr, fp, fmt0, ap), } nassigned++; } - nread += p - buf; + nread += p - buf + skips; break; } #ifdef FLOATING_POINT |