>From 93a0a7065b239dacdcd831022f2bd109e1f4493a Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 1 Jun 2017 14:08:00 -0700 Subject: [PATCH] error: fix POSIX violation for va_end Problem reported by Bruno Haible in: http://lists.gnu.org/archive/html/bug-gnulib/2017-06/msg00001.html * lib/error.c (error_tail): Do not call va_end here. (error, error_at_line): Call it here instead. --- ChangeLog | 8 ++++++++ lib/error.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1b99b71..ae9e39d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2017-06-01 Paul Eggert + + error: fix POSIX violation for va_end + Problem reported by Bruno Haible in: + http://lists.gnu.org/archive/html/bug-gnulib/2017-06/msg00001.html + * lib/error.c (error_tail): Do not call va_end here. + (error, error_at_line): Call it here instead. + 2017-05-28 Bruno Haible c-strtod: Make it usable in C++ mode. diff --git a/lib/error.c b/lib/error.c index 418d1ab..ba05eaa 100644 --- a/lib/error.c +++ b/lib/error.c @@ -272,7 +272,6 @@ error_tail (int status, int errnum, const char *message, va_list args) else #endif vfprintf (stderr, message, args); - va_end (args); ++error_message_count; if (errnum) @@ -322,6 +321,7 @@ error (int status, int errnum, const char *message, ...) va_start (args, message); error_tail (status, errnum, message, args); + va_end (args); #ifdef _LIBC _IO_funlockfile (stderr); @@ -392,6 +392,7 @@ error_at_line (int status, int errnum, const char *file_name, va_start (args, message); error_tail (status, errnum, message, args); + va_end (args); #ifdef _LIBC _IO_funlockfile (stderr); -- 2.9.4