xprintf fixes.
authorJim Meyering <meyering@redhat.com>
Sat, 20 Oct 2007 14:19:33 +0000 (16:19 +0200)
committerJim Meyering <meyering@redhat.com>
Sat, 20 Oct 2007 14:19:33 +0000 (16:19 +0200)
* lib/xprintf.c (xprintf, xfprintf): Use va_end.
Use a clearer diagnostic.
Patch from Bruno Haible.

ChangeLog
lib/xprintf.c

index 96a9a09..159f69e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-10-20  Jim Meyering  <meyering@redhat.com>
+
+       xprintf fixes.
+       * lib/xprintf.c (xprintf, xfprintf): Use va_end.
+       Use a clearer diagnostic.
+       Patch from Bruno Haible.
+
 2007-10-20  Bruno Haible  <bruno@clisp.org>
 
        * lib/vasnprintf.c (VASNPRINTF): Don't report overflow if the available
index 2134e26..6ecd2a2 100644 (file)
@@ -38,7 +38,8 @@ xprintf (char const *restrict format, ...)
   va_start (args, format);
   int err = vprintf (format, args);
   if (err < 0 && ! ferror (stdout))
-    error (exit_failure, errno, gettext ("write error"));
+    error (exit_failure, errno, gettext ("cannot perform formatted output"));
+  va_end (args);
 
   return err;
 }
@@ -52,7 +53,8 @@ xfprintf (FILE *restrict stream, char const *restrict format, ...)
   va_start (args, format);
   int err = vfprintf (stream, format, args);
   if (err < 0 && ! ferror (stream))
-    error (exit_failure, errno, gettext ("write error"));
+    error (exit_failure, errno, gettext ("cannot perform formatted output"));
+  va_end (args);
 
   return err;
 }