unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Truncated fatal error messages
@ 2012-09-22  8:08 Eli Zaretskii
  2012-09-22  8:22 ` Andreas Schwab
  2012-09-22  8:24 ` Paul Eggert
  0 siblings, 2 replies; 3+ messages in thread
From: Eli Zaretskii @ 2012-09-22  8:08 UTC (permalink / raw)
  To: Paul Eggert; +Cc: emacs-devel

This change:

  @@ -2012,7 +2014,12 @@ shut_down_emacs (int sig, Lisp_Object st
	 {
	  reset_all_sys_modes ();
	  if (sig && sig != SIGTERM)
  -	  fprintf (stderr, "Fatal error %d: %s", sig, strsignal (sig));
  +	  {
  +	    char buf[100];
  +	    int buflen = snprintf (buf, sizeof buf, "Fatal error %d: %s",
  +				   sig, strsignal (sig));
  +	    ignore_value (write (STDERR_FILENO, buf, buflen));
  +	  }
	 }
     }
   #else

arbitrarily limits the signal description due to the 99-char limit of
the buffer.  Isn't it better to allocate the buffer (with alloca)
based on the length of the signal description?



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-22  8:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-22  8:08 Truncated fatal error messages Eli Zaretskii
2012-09-22  8:22 ` Andreas Schwab
2012-09-22  8:24 ` Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).