Handle printf ("%#.0o",0);

This commit is contained in:
Nick Clifton 2001-05-28 18:22:44 +00:00
parent 51352f8ed0
commit 188bc140c0
2 changed files with 16 additions and 0 deletions

View File

@ -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

View File

@ -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;