summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-08-29 13:57:42 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-08-29 13:57:42 -0700
commit6e1a67fbe915e6fdc1d63a8e6c434aa79e4e7fb4 (patch)
treef2a9bd3650385156ec388db480dbbf56c2cb22a8 /src
parent1a091fbc08faa3bab85e74f7fac72a955600a8f6 (diff)
* font.c, gtkutil.c: Include <float.h>.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/font.c1
-rw-r--r--src/gtkutil.c1
3 files changed, 6 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9f86c42d43b..1de15f4796e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -39,7 +39,8 @@
* filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
- * font.c (font_unparse_xlfd): Don't blindly alloca long strings.
+ * font.c: Include <float.h>, for DBL_MAX_10_EXP.
+ (font_unparse_xlfd): Don't blindly alloca long strings.
Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
fits in int, when using sprintf. Use single snprintf to count
length of string rather than counting it via multiple sprintfs;
@@ -62,7 +63,8 @@
use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
not fit in int.
- * gtkutil.c (xg_check_special_colors, xg_set_geometry):
+ * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
+ (xg_check_special_colors, xg_set_geometry):
Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
* lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
diff --git a/src/font.c b/src/font.c
index cc5939982d3..1609a2cc9ff 100644
--- a/src/font.c
+++ b/src/font.c
@@ -21,6 +21,7 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include <float.h>
#include <stdio.h>
#include <ctype.h>
#include <setjmp.h>
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 5f23d597329..c154797735e 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#ifdef USE_GTK
+#include <float.h>
#include <signal.h>
#include <stdio.h>
#include <setjmp.h>