From: Paul Eggert Date: Sat, 22 Sep 2012 08:22:49 +0000 (-0700) Subject: Do not truncate strsignal output. X-Git-Tag: emacs-24.2.90~265 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=703342f8d8e95f0912212f5289b40d25bc021134;p=emacs.git Do not truncate strsignal output. --- 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))); } } }