Module Name: src
Committed By: martin
Date: Sun Jul 21 11:35:37 UTC 2019
Modified Files:
src/usr.sbin/sysinst: util.c
Log Message:
scripting_fprintf: when we traverse the va_list twice, we need to save
it before the first and reset it before the second pass.
To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 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.26 src/usr.sbin/sysinst/util.c:1.27
--- src/usr.sbin/sysinst/util.c:1.26 Mon Jul 8 19:36:02 2019
+++ src/usr.sbin/sysinst/util.c Sun Jul 21 11:35:36 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: util.c,v 1.26 2019/07/08 19:36:02 martin Exp $ */
+/* $NetBSD: util.c,v 1.27 2019/07/21 11:35:36 martin Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -1469,9 +1469,14 @@ done:
void
scripting_vfprintf(FILE *f, const char *fmt, va_list ap)
{
+ va_list saved;
+ if (f && script)
+ va_copy(saved, ap);
if (f)
(void)vfprintf(f, fmt, ap);
+ if (f && script)
+ va_copy(ap, saved);
if (script)
(void)vfprintf(script, fmt, ap);
}