Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/sysinst scripting_fprintf: when we traverse the va_...



details:   https://anonhg.NetBSD.org/src/rev/b10a290d876e
branches:  trunk
changeset: 457798:b10a290d876e
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Jul 21 11:35:36 2019 +0000

description:
scripting_fprintf: when we traverse the va_list twice, we need to save
it before the first and reset it before the second pass.

diffstat:

 usr.sbin/sysinst/util.c |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (24 lines):

diff -r 6924c72ad52b -r b10a290d876e usr.sbin/sysinst/util.c
--- a/usr.sbin/sysinst/util.c   Sun Jul 21 11:35:13 2019 +0000
+++ b/usr.sbin/sysinst/util.c   Sun Jul 21 11:35:36 2019 +0000
@@ -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 @@
 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);
 }



Home | Main Index | Thread Index | Old Index