emacs-diffs
[Top][All Lists]
Advanced

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

master 190582adf4 2/2: Don’t truncate seccomp-filter diagnostic


From: Paul Eggert
Subject: master 190582adf4 2/2: Don’t truncate seccomp-filter diagnostic
Date: Sun, 2 Oct 2022 16:48:04 -0400 (EDT)

branch: master
commit 190582adf416790e072ec5a605bd43048a82784a
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>

    Don’t truncate seccomp-filter diagnostic
    
    * lib-src/seccomp-filter.c (fail): Do not truncate diagnostic
    arbitrarily to 1000 bytes when ERROR is nonzero.
---
 lib-src/seccomp-filter.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/lib-src/seccomp-filter.c b/lib-src/seccomp-filter.c
index 061af9dc07..041bf5c749 100644
--- a/lib-src/seccomp-filter.c
+++ b/lib-src/seccomp-filter.c
@@ -69,19 +69,16 @@ fail (int error, const char *format, ...)
 {
   va_list ap;
   va_start (ap, format);
+  vfprintf (stderr, format, ap);
+  va_end (ap);
   if (error == 0)
-    {
-      vfprintf (stderr, format, ap);
-      fputc ('\n', stderr);
-    }
+    fputc ('\n', stderr);
   else
     {
-      char buffer[1000];
-      vsnprintf (buffer, sizeof buffer, format, ap);
+      fputs (": ", stderr);
       errno = error;
-      perror (buffer);
+      perror (NULL);
     }
-  va_end (ap);
   fflush (NULL);
   exit (EXIT_FAILURE);
 }



reply via email to

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