From: Jim Meyering Date: Sat, 20 Oct 2007 14:19:33 +0000 (+0200) Subject: xprintf fixes. X-Git-Tag: v0.0~52 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=3d45e2853ce7ba93f0c2a84f88a200aa3fb4392c;p=gnulib.git xprintf fixes. * lib/xprintf.c (xprintf, xfprintf): Use va_end. Use a clearer diagnostic. Patch from Bruno Haible. --- diff --git a/ChangeLog b/ChangeLog index 96a9a09bd..159f69efb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-10-20 Jim Meyering + + xprintf fixes. + * lib/xprintf.c (xprintf, xfprintf): Use va_end. + Use a clearer diagnostic. + Patch from Bruno Haible. + 2007-10-20 Bruno Haible * lib/vasnprintf.c (VASNPRINTF): Don't report overflow if the available diff --git a/lib/xprintf.c b/lib/xprintf.c index 2134e2614..6ecd2a2ad 100644 --- a/lib/xprintf.c +++ b/lib/xprintf.c @@ -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; }