Module Name: src Committed By: martin Date: Sun Jul 21 12:23:18 UTC 2019
Modified Files: src/usr.sbin/sysinst: util.c Log Message: scripting_vprintf: to simplify things for gcc (and avoid "may be used uninitialized" warnings) just always copy the va_list and use one copy for the first pass, the other for the second. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/usr.sbin/sysinst/util.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.sbin/sysinst/util.c diff -u src/usr.sbin/sysinst/util.c:1.27 src/usr.sbin/sysinst/util.c:1.28 --- src/usr.sbin/sysinst/util.c:1.27 Sun Jul 21 11:35:36 2019 +++ src/usr.sbin/sysinst/util.c Sun Jul 21 12:23:18 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: util.c,v 1.27 2019/07/21 11:35:36 martin Exp $ */ +/* $NetBSD: util.c,v 1.28 2019/07/21 12:23:18 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1469,16 +1469,13 @@ done: void scripting_vfprintf(FILE *f, const char *fmt, va_list ap) { - va_list saved; + va_list ap2; - if (f && script) - va_copy(saved, ap); + va_copy(ap2, ap); if (f) (void)vfprintf(f, fmt, ap); - if (f && script) - va_copy(ap, saved); if (script) - (void)vfprintf(script, fmt, ap); + (void)vfprintf(script, fmt, ap2); } void