Commit 6e1a67fb authored by Paul Eggert's avatar Paul Eggert
Browse files

* font.c, gtkutil.c: Include <float.h>.

parent 1a091fbc
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
* filelock.c (lock_file_1, lock_file): Don't blindly alloca long name; * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues. 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 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
fits in int, when using sprintf. Use single snprintf to count fits in int, when using sprintf. Use single snprintf to count
length of string rather than counting it via multiple sprintfs; length of string rather than counting it via multiple sprintfs;
...@@ -62,7 +63,8 @@ ...@@ -62,7 +63,8 @@
use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
not fit in int. 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. Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
* lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA. * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
......
...@@ -21,6 +21,7 @@ You should have received a copy of the GNU General Public License ...@@ -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/>. */ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h> #include <config.h>
#include <float.h>
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
#include <setjmp.h> #include <setjmp.h>
......
...@@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ ...@@ -20,6 +20,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h> #include <config.h>
#ifdef USE_GTK #ifdef USE_GTK
#include <float.h>
#include <signal.h> #include <signal.h>
#include <stdio.h> #include <stdio.h>
#include <setjmp.h> #include <setjmp.h>
......
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