]> sourceware.org Git - newlib-cygwin.git/commitdiff
stdio: Parse 0x0p+00 correctly in scanf
authorKeith Packard <keithp@keithp.com>
Fri, 18 Jun 2021 18:09:48 +0000 (11:09 -0700)
committerJeff Johnston <jjohnstn@redhat.com>
Fri, 18 Jun 2021 21:15:37 +0000 (17:15 -0400)
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>
newlib/libc/stdio/vfscanf.c

index 1d5e6512afb1673baf373ce6c9165f5e4d53cff3..037692531f1fdf90d0002ee2b80273833311d28d 100644 (file)
@@ -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';
This page took 0.031093 seconds and 5 git commands to generate.