From c57b67fcf07e10378fbb11cf8c6aecded43d1736 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 29 Aug 2011 11:48:24 -0700 Subject: [PATCH] * fontset.c (num_auto_fontsets): Now printmax_t, not int. (fontset_from_font): Print it. --- src/ChangeLog | 3 +++ src/fontset.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index f94f9c4632f..a1af6127635 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -49,6 +49,9 @@ (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not sprintf, in case result does not fit in int. + * fontset.c (num_auto_fontsets): Now printmax_t, not int. + (fontset_from_font): Print it. + 2011-08-26 Paul Eggert Integer and memory overflow issues (Bug#9196). diff --git a/src/fontset.c b/src/fontset.c index c8ae1e74848..74a25a1ca04 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -1700,7 +1700,7 @@ FONT-SPEC is a vector, a cons, or a string. See the documentation of static Lisp_Object auto_fontset_alist; /* Number of automatically created fontsets. */ -static int num_auto_fontsets; +static printmax_t num_auto_fontsets; /* Retun a fontset synthesized from FONT-OBJECT. This is called from x_new_font when FONT-OBJECT is used for the default ASCII font of a @@ -1727,9 +1727,9 @@ fontset_from_font (Lisp_Object font_object) alias = intern ("fontset-startup"); else { - char temp[32]; + char temp[sizeof "fontset-auto" + INT_STRLEN_BOUND (printmax_t)]; - sprintf (temp, "fontset-auto%d", num_auto_fontsets - 1); + sprintf (temp, "fontset-auto%"pMd, num_auto_fontsets - 1); alias = intern (temp); } fontset_spec = copy_font_spec (font_spec); -- 2.39.2