]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
error: fix POSIX violation for va_end
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 1 Jun 2017 21:08:00 +0000 (14:08 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 1 Jun 2017 21:12:18 +0000 (14:12 -0700)
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
lib/error.c

index 1b99b71ace9e658fc29cc092282624c0ced79802..ae9e39d06fa41ceb27a9afa30e59b0832835f8a2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2017-06-01  Paul Eggert  <eggert@cs.ucla.edu>
+
+       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  <bruno@clisp.org>
 
        c-strtod: Make it usable in C++ mode.
index 418d1ab8dee38fbc983aeecdc6d0338925e5e32e..ba05eaa2161a627fdb9397c7f98beff948c29f4c 100644 (file)
@@ -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);