[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Truncated fatal error messages

From: Eli Zaretskii
Subject: Truncated fatal error messages
Date: Sat, 22 Sep 2012 11:08:24 +0300

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));
  +       }

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?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]