mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-04 08:40:33 +08:00
re PR libfortran/79540 (FAIL: gfortran.dg/fmt_fw_d.f90 -O0 execution test)
PR libgfortran/79540 * io/write_float.def (build_float_string): Don't copy digits when ndigits is negative. From-SVN: r269911
This commit is contained in:
parent
a260f36938
commit
b7ca376ae9
@ -1,3 +1,9 @@
|
||||
2019-03-25 John David Anglin <danglin@gcc.gnu.org>
|
||||
|
||||
PR libgfortran/79540
|
||||
* io/write_float.def (build_float_string): Don't copy digits when
|
||||
ndigits is negative.
|
||||
|
||||
2019-03-05 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR libgfortran/89593
|
||||
|
@ -620,14 +620,15 @@ build_float_string (st_parameter_dt *dtp, const fnode *f, char *buffer,
|
||||
}
|
||||
|
||||
/* Set digits after the decimal point, padding with zeros. */
|
||||
if (nafter > 0)
|
||||
if (ndigits >= 0 && nafter > 0)
|
||||
{
|
||||
if (nafter > ndigits)
|
||||
i = ndigits;
|
||||
else
|
||||
i = nafter;
|
||||
|
||||
memcpy (put, digits, i);
|
||||
if (i > 0)
|
||||
memcpy (put, digits, i);
|
||||
while (i < nafter)
|
||||
put[i++] = '0';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user