From: Keith Packard Date: Fri, 18 Jun 2021 18:09:48 +0000 (-0700) Subject: stdio: Parse 0x0p+00 correctly in scanf X-Git-Tag: cygwin-3_3_0-release~159 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=92068f4cc5f2cb655b32a46fdba93a9e572c307b;p=newlib-cygwin.git 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 --- 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';