# HG changeset patch # User Jim Meyering # Date 1192889973 -7200 # Node ID 091bbc680bf8c7860c8d6500dd580d0b1fe10488 # Parent 8b3c480382570e5ef7ee05a859df36ea4a9010f5 xprintf fixes. * lib/xprintf.c (xprintf, xfprintf): Use va_end. Use a clearer diagnostic. Patch from Bruno Haible. diff --git a/ChangeLog b/ChangeLog --- 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 --- a/lib/xprintf.c +++ b/lib/xprintf.c @@ -38,7 +38,8 @@ 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 @@ 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; }