aboutsummaryrefslogtreecommitdiffstats
path: root/src/print.c
diff options
context:
space:
mode:
authorMichael Welsh Duggan2011-02-14 17:25:29 -0500
committerChong Yidong2011-02-14 17:25:29 -0500
commit75b43359dd68edd356d9f611ebc3dd5b477fa637 (patch)
tree2a2deaeb8fc360762e77a4596d6c7e1b65c511f9 /src/print.c
parentaa0935b987a4a10e8adcd1af64ea4fc10e860e54 (diff)
downloademacs-75b43359dd68edd356d9f611ebc3dd5b477fa637.tar.gz
emacs-75b43359dd68edd356d9f611ebc3dd5b477fa637.zip
Fix use of dtoastr from gnulib.
* src/print.c (float_to_string): Ensure that a decimal point is printed if using dtoastr (Bug#8033).
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';