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/e428745706c7
branches:  trunk
changeset: 962423:e428745706c7
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 d0226fe025a1 -r e428745706c7 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