Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2004-10-04 21:51:50 +0400
committerJeff Johnston <jjohnstn@redhat.com>2004-10-04 21:51:50 +0400
commit3ea9de7644c3110f6f8394501cd26a38852c95e9 (patch)
tree727eabbfae37c3aa5325e6e81136653f1037acfd /newlib/libc/stdio
parent298cac75d584b02beb1313b0f60f72a54064b6e5 (diff)
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')
-rw-r--r--newlib/libc/stdio/vfscanf.c4
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