diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2018-07-31 11:51:13 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2018-07-31 11:55:21 +0300 |
commit | 4ef7f9ab13bcf8483050c932110c88f7ae9c75a7 (patch) | |
tree | 4b3ab69d4c1c9f82acc1e63fdc4067690929b8e9 | |
parent | 970930e09c25ea7e07cd728961ae601d3dd22c41 (diff) | |
download | paxutils-4ef7f9ab13bcf8483050c932110c88f7ae9c75a7.tar.gz paxutils-4ef7f9ab13bcf8483050c932110c88f7ae9c75a7.tar.bz2 |
Fix in rmt
* rmt/rmt.c (VDEBUG): Take 3 arguments.
Maintain a local va_list variable.
(rmt_write): Add missing va_end
-rw-r--r-- | rmt/rmt.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -51,13 +51,16 @@ FILE *dbgout; } \ while (0) -#define VDEBUG(lev, pfx, fmt, ap) \ +#define VDEBUG(lev, pfx, fmt) \ do \ { \ if (dbgout && (lev) <= dbglev) \ { \ + va_list aptr; \ + va_start (aptr, fmt); \ fprintf (dbgout, "%s", pfx); \ - vfprintf (dbgout, fmt, ap); \ + vfprintf (dbgout, fmt, aptr); \ + va_end (aptr); \ } \ } \ while (0) @@ -100,8 +103,9 @@ rmt_write (const char *fmt, ...) va_list ap; va_start (ap, fmt); vfprintf (stdout, fmt, ap); + va_end (ap); fflush (stdout); - VDEBUG (10, "S: ", fmt, ap); + VDEBUG (10, "S: ", fmt); } static void |