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>
This commit is contained in:
Keith Packard 2021-06-18 11:09:48 -07:00 committed by Jeff Johnston
parent 90a72f27d5
commit 92068f4cc5
1 changed files with 1 additions and 0 deletions

View File

@ -1628,6 +1628,7 @@ __SVFSCANF_R (struct _reent *rptr,
&& zeroes == 1) && zeroes == 1)
{ {
flags |= HEXFLT; flags |= HEXFLT;
flags &= ~NDIGITS;
/* We skipped the first zero, so we have to add /* We skipped the first zero, so we have to add
it now to the buffer. */ it now to the buffer. */
*p++ = '0'; *p++ = '0';