Commit 75b43359 authored by Michael Welsh Duggan's avatar Michael Welsh Duggan Committed by Chong Yidong
Browse files

Fix use of dtoastr from gnulib.

* src/print.c (float_to_string): Ensure that a decimal point is
printed if using dtoastr (Bug#8033).
parent aa0935b9
2011-02-14 Michael Welsh Duggan <md5i@md5i.com>
* print.c (float_to_string): Ensure that a decimal point is
printed if using dtoastr (Bug#8033).
2011-02-14 Eli Zaretskii <eliz@gnu.org>
 
* msdos.c (IT_frame_up_to_date):
......@@ -1062,7 +1062,10 @@ float_to_string (char *buf, double data)
{
/* Generate the fewest number of digits that represent the
floating point value without losing information. */
dtoastr (buf, FLOAT_TO_STRING_BUFSIZE, 0, 0, data);
dtoastr (buf, FLOAT_TO_STRING_BUFSIZE - 2, 0, 0, data);
/* The decimal point must be printed, or the byte compiler can
get confused (Bug#8033). */
width = 1;
}
else /* oink oink */
{
......@@ -1117,8 +1120,7 @@ float_to_string (char *buf, double data)
cp[1] = '0';
cp[2] = 0;
}
if (*cp == 0)
else if (*cp == 0)
{
*cp++ = '.';
*cp++ = '0';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment