From 8b57e664af6cedcbd20a5f4c37ee364b5e13e97a Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Wed, 2 Jun 2004 19:22:14 +0000 Subject: 2004-06-02 Jeff Johnston * libc/stdio/vfscanf.c (__svfscanf_r): For CT_INT conversions, reset digit flags appropriately after we have discovered "0x". * libc/machine/powerpc/vfscanf.c (__svfscanf_r): Ditto. --- newlib/ChangeLog | 6 ++++++ newlib/libc/machine/powerpc/vfscanf.c | 4 ++++ newlib/libc/stdio/vfscanf.c | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/newlib/ChangeLog b/newlib/ChangeLog index c1866d86d..0e2204220 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,9 @@ +2004-06-02 Jeff Johnston + + * libc/stdio/vfscanf.c (__svfscanf_r): For CT_INT conversions, + reset digit flags appropriately after we have discovered "0x". + * libc/machine/powerpc/vfscanf.c (__svfscanf_r): Ditto. + 2004-05-27 Jeff Johnston * libc/stdio/vfprintf.c (_VFPRINTF): Move file locking 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; -- cgit v1.2.3