From 703342f8d8e95f0912212f5289b40d25bc021134 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 22 Sep 2012 01:22:49 -0700 Subject: [PATCH] Do not truncate strsignal output. --- src/emacs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/emacs.c b/src/emacs.c index a483f3848cf..52f38925b32 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2015,10 +2015,12 @@ shut_down_emacs (int sig, Lisp_Object stuff) reset_all_sys_modes (); if (sig && sig != SIGTERM) { - char buf[100]; - int buflen = snprintf (buf, sizeof buf, "Fatal error %d: %s", - sig, strsignal (sig)); + static char const format[] = "Fatal error %d: "; + char buf[sizeof format - 2 + INT_STRLEN_BOUND (int)]; + int buflen = sprintf (buf, format, sig); + char const *sig_desc = strsignal (sig); ignore_value (write (STDERR_FILENO, buf, buflen)); + ignore_value (write (STDERR_FILENO, sig_desc, strlen (sig_desc))); } } } -- 2.39.2