diff options
author | Nick Clifton <nickc@redhat.com> | 2001-05-28 18:22:44 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2001-05-28 18:22:44 +0000 |
commit | 188bc140c02e97423fac4f5efdb68e60bc0c37b0 (patch) | |
tree | 0cbf717151183e7a067814385423e1e89a725fa3 /newlib | |
parent | 51352f8ed0896b8b719bf40f2980e291a6564186 (diff) | |
download | newlib-188bc140c02e97423fac4f5efdb68e60bc0c37b0.zip newlib-188bc140c02e97423fac4f5efdb68e60bc0c37b0.tar.gz newlib-188bc140c02e97423fac4f5efdb68e60bc0c37b0.tar.bz2 |
Handle printf ("%#.0o",0);
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/ChangeLog | 4 | ||||
-rw-r--r-- | newlib/libc/stdio/vfprintf.c | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 5c23dec..d83c52f 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,7 @@ +2001-05-28 Nick Clifton <nickc@cambridge.redhat.com> + + * libc/stdio/vfprintf.c (_VFPRINTF_R): Handle printf ("%#.0o",0) + 2001-05-25 Nick Clifton <nickc@cambridge.redhat.com> * libc/machine/xscale/memcmp.c: Fix bug when both pointers have diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c index 9a2cf4f..f6bba49 100644 --- a/newlib/libc/stdio/vfprintf.c +++ b/newlib/libc/stdio/vfprintf.c @@ -790,6 +790,18 @@ number: if ((dprec = prec) >= 0) goto skipsize; } } + /* + * ...result is to be converted to an 'alternate form'. + * For o conversion, it increases the precision to force + * the first digit of the result to be a zero." + * -- ANSI X3J11 + * + * To demonstrate this case, compile and run: + * printf ("%#.0o",0); + */ + else if (base == OCT && (flags & ALT)) + *--cp = '0'; + size = buf + BUF - cp; skipsize: break; |