From a66ff6d8b7f1ba4a8ef4d52f7d66b7804ba97091 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 29 Aug 2011 12:09:16 -0700 Subject: [PATCH] * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf, in case result does not fit in int. --- src/ChangeLog | 3 +++ src/nsterm.m | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index b69830b23a0..362109acbe6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -74,6 +74,9 @@ (Fexecute_kbd_macro): Don't assume repeat count fits in int. * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int. + * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf, + in case result does not fit in int. + 2011-08-26 Paul Eggert Integer and memory overflow issues (Bug#9196). diff --git a/src/nsterm.m b/src/nsterm.m index 4c9574c35ba..827404a2974 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -5316,7 +5316,7 @@ ns_term_shutdown (int sig) strcpy (old_title, t); } size_title = xmalloc (strlen (old_title) + 40); - sprintf (size_title, "%s — (%d x %d)", old_title, cols, rows); + esprintf (size_title, "%s — (%d x %d)", old_title, cols, rows); [window setTitle: [NSString stringWithUTF8String: size_title]]; [window display]; xfree (size_title); -- 2.39.2