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:
authorKeith Packard <keithp@keithp.com>2021-06-18 21:09:48 +0300
committerJeff Johnston <jjohnstn@redhat.com>2021-06-19 00:15:37 +0300
commit92068f4cc5f2cb655b32a46fdba93a9e572c307b (patch)
treea348c9c1a46fa0e4ee127af5ea8abf519ee71a49 /newlib/libc
parent90a72f27d5f724b496525b54a5d9f99cdcecbb9c (diff)
stdio: Parse 0x0p+00 correctly in scanf
The scanf code was skipping the '0' after the 'x' causing the resulting buffer to contain an invalid number when passed to strtod. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/stdio/vfscanf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/newlib/libc/stdio/vfscanf.c b/newlib/libc/stdio/vfscanf.c
index 1d5e6512a..037692531 100644
--- a/newlib/libc/stdio/vfscanf.c
+++ b/newlib/libc/stdio/vfscanf.c
@@ -1628,6 +1628,7 @@ __SVFSCANF_R (struct _reent *rptr,
&& zeroes == 1)
{
flags |= HEXFLT;
+ flags &= ~NDIGITS;
/* We skipped the first zero, so we have to add
it now to the buffer. */
*p++ = '0';