aboutsummaryrefslogtreecommitdiffstats
path: root/src/print.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/print.c')
-rw-r--r--src/print.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/print.c b/src/print.c
index b5b278bf17f..beb14a8b679 100644
--- a/src/print.c
+++ b/src/print.c
@@ -1062,7 +1062,10 @@ float_to_string (char *buf, double data)
1062 { 1062 {
1063 /* Generate the fewest number of digits that represent the 1063 /* Generate the fewest number of digits that represent the
1064 floating point value without losing information. */ 1064 floating point value without losing information. */
1065 dtoastr (buf, FLOAT_TO_STRING_BUFSIZE, 0, 0, data); 1065 dtoastr (buf, FLOAT_TO_STRING_BUFSIZE - 2, 0, 0, data);
1066 /* The decimal point must be printed, or the byte compiler can
1067 get confused (Bug#8033). */
1068 width = 1;
1066 } 1069 }
1067 else /* oink oink */ 1070 else /* oink oink */
1068 { 1071 {
@@ -1117,8 +1120,7 @@ float_to_string (char *buf, double data)
1117 cp[1] = '0'; 1120 cp[1] = '0';
1118 cp[2] = 0; 1121 cp[2] = 0;
1119 } 1122 }
1120 1123 else if (*cp == 0)
1121 if (*cp == 0)
1122 { 1124 {
1123 *cp++ = '.'; 1125 *cp++ = '.';
1124 *cp++ = '0'; 1126 *cp++ = '0';