From 3d45e2853ce7ba93f0c2a84f88a200aa3fb4392c Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 20 Oct 2007 16:19:33 +0200 Subject: [PATCH] xprintf fixes. * lib/xprintf.c (xprintf, xfprintf): Use va_end. Use a clearer diagnostic. Patch from Bruno Haible. --- ChangeLog | 7 +++++++ lib/xprintf.c | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 96a9a09bdf..159f69efbf 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 2134e26141..6ecd2a2ad7 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; } -- 2.30.2