Don’t truncate seccomp-filter diagnostic

* lib-src/seccomp-filter.c (fail): Do not truncate diagnostic
arbitrarily to 1000 bytes when ERROR is nonzero.
This commit is contained in:
Paul Eggert 2022-10-02 13:47:09 -07:00
parent 5598886adc
commit 190582adf4

View file

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