diff options
| author | David Schultz <das@FreeBSD.org> | 2005-04-16 22:36:51 +0000 |
|---|---|---|
| committer | David Schultz <das@FreeBSD.org> | 2005-04-16 22:36:51 +0000 |
| commit | 1be5319a76792390e57ecb358958469df96f39d6 (patch) | |
| tree | a5f6c9f1e67f01c6fca27366c5bdc6e2c17baf69 /lib/libc/stdio | |
| parent | a4ca7ca8acbc6c019958eb0efb0230c800adeeec (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdio')
| -rw-r--r-- | lib/libc/stdio/vfprintf.c | 10 | ||||
| -rw-r--r-- | lib/libc/stdio/vfwprintf.c | 10 |
2 files changed, 16 insertions, 4 deletions
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c index ff688e7c86a8..790f687a31fe 100644 --- a/lib/libc/stdio/vfprintf.c +++ b/lib/libc/stdio/vfprintf.c @@ -1093,16 +1093,22 @@ number: if ((dprec = prec) >= 0) * ``The result of converting a zero value with an * explicit precision of zero is no characters.'' * -- ANSI X3J11 + * + * ``The C Standard is clear enough as is. The call + * printf("%#.0o", 0) should print 0.'' + * -- Defect Report #151 */ cp = buf + BUF; if (flags & INTMAX_SIZE) { - if (ujval != 0 || prec != 0) + if (ujval != 0 || prec != 0 || + (flags & ALT && base == 8)) cp = __ujtoa(ujval, cp, base, flags & ALT, xdigs, flags & GROUPING, thousands_sep, grouping); } else { - if (ulval != 0 || prec != 0) + if (ulval != 0 || prec != 0 || + (flags & ALT && base == 8)) cp = __ultoa(ulval, cp, base, flags & ALT, xdigs, flags & GROUPING, thousands_sep, diff --git a/lib/libc/stdio/vfwprintf.c b/lib/libc/stdio/vfwprintf.c index d93e507a53b2..2a332e7ff693 100644 --- a/lib/libc/stdio/vfwprintf.c +++ b/lib/libc/stdio/vfwprintf.c @@ -1092,16 +1092,22 @@ number: if ((dprec = prec) >= 0) * ``The result of converting a zero value with an * explicit precision of zero is no characters.'' * -- ANSI X3J11 + * + * ``The C Standard is clear enough as is. The call + * printf("%#.0o", 0) should print 0.'' + * -- Defect Report #151 */ cp = buf + BUF; if (flags & INTMAX_SIZE) { - if (ujval != 0 || prec != 0) + if (ujval != 0 || prec != 0 || + (flags & ALT && base == 8)) cp = __ujtoa(ujval, cp, base, flags & ALT, xdigs, flags & GROUPING, thousands_sep, grouping); } else { - if (ulval != 0 || prec != 0) + if (ulval != 0 || prec != 0 || + (flags & ALT && base == 8)) cp = __ultoa(ulval, cp, base, flags & ALT, xdigs, flags & GROUPING, thousands_sep, |
