PR libgfortran/79540
* io/write_float.def (build_float_string): Don't copy digits when
ndigits is negative.
From-SVN: r269911
+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
}
/* 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';