mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-22 15:47:37 +00:00
Fix zero-padding for printf formats which include a precision or
width. This is a vendor-supplied patch. Requested by: bde Submitted by: Aharon Robbins <arnold@skeeve.com>
This commit is contained in:
parent
58f9831e32
commit
7dfb2a9760
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55056
@ -463,7 +463,13 @@ register NODE *carg;
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case '0':
|
case '0':
|
||||||
zero_flag = TRUE;
|
/*
|
||||||
|
* Only turn on zero_flag if we haven't seen
|
||||||
|
* the field width or precision yet. Otherwise,
|
||||||
|
* screws up floating point formatting.
|
||||||
|
*/
|
||||||
|
if (cur == & fw)
|
||||||
|
zero_flag = TRUE;
|
||||||
if (lj)
|
if (lj)
|
||||||
goto retry;
|
goto retry;
|
||||||
/* FALL through */
|
/* FALL through */
|
||||||
@ -2006,7 +2012,7 @@ NODE *tree;
|
|||||||
free_temp(tmp);
|
free_temp(tmp);
|
||||||
|
|
||||||
if (do_lint) {
|
if (do_lint) {
|
||||||
if (uval < 0)
|
if (d < 0)
|
||||||
warning("compl(%lf): negative value will give strange results", d);
|
warning("compl(%lf): negative value will give strange results", d);
|
||||||
if (double_to_int(d) != d)
|
if (double_to_int(d) != d)
|
||||||
warning("compl(%lf): fractional value will be truncated", d);
|
warning("compl(%lf): fractional value will be truncated", d);
|
||||||
|
Loading…
Reference in New Issue
Block a user