INSTALLER - Fix a bug with varargs
authorAntonio Huete <tuxillo@quantumachine.net>
Mon, 17 Aug 2009 22:05:48 +0000 (22:05 +0000)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 17 Aug 2009 23:57:29 +0000 (16:57 -0700)
In i_log() function, vfprintf() is used twice in a va_start()/va_end()
block.

Submitted-by: Antonio Huete <tuxillo@quantumachine.net>
usr.sbin/installer/libinstaller/functions.c

index 90805a7..c700ae2 100644 (file)
@@ -160,10 +160,13 @@ i_log(struct i_fn_args *a, const char *fmt, ...)
        va_start(args, fmt);
        vfprintf(stderr, fmt, args);
        fprintf(stderr, "\n");
+       va_end(args);
        if (a->log != NULL) {
+               va_start(args, fmt);
                vfprintf(a->log, fmt, args);
                fprintf(a->log, "\n");
                fflush(a->log);
+               va_end(args);
        }
        va_end(args);
 }