diff options
Diffstat (limited to 'newlib/libc')
-rw-r--r-- | newlib/libc/machine/powerpc/vfscanf.c | 4 | ||||
-rw-r--r-- | newlib/libc/stdio/vfscanf.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/newlib/libc/machine/powerpc/vfscanf.c b/newlib/libc/machine/powerpc/vfscanf.c index c0d48a886..602fd7735 100644 --- a/newlib/libc/machine/powerpc/vfscanf.c +++ b/newlib/libc/machine/powerpc/vfscanf.c @@ -911,6 +911,10 @@ __svfscanf_r (rptr, fp, fmt0, ap) { base = 16;/* if %i */ flags &= ~PFXOK; + /* We must reset the NZDIGITS and NDIGITS + flags that would have been unset by seeing + the zero that preceded the X or x. */ + flags |= NZDIGITS | NDIGITS; goto ok; } break; diff --git a/newlib/libc/stdio/vfscanf.c b/newlib/libc/stdio/vfscanf.c index e5bb345ec..5e92febed 100644 --- a/newlib/libc/stdio/vfscanf.c +++ b/newlib/libc/stdio/vfscanf.c @@ -872,6 +872,10 @@ _DEFUN(__svfscanf_r, (rptr, fp, fmt0, ap), { base = 16;/* if %i */ flags &= ~PFXOK; + /* We must reset the NZDIGITS and NDIGITS + flags that would have been unset by seeing + the zero that preceded the X or x. */ + flags |= NZDIGITS | NDIGITS; goto ok; } break; |