summaryrefslogtreecommitdiff
path: root/libbio
diff options
context:
space:
mode:
authorCharles Forsyth <charles.forsyth@gmail.com>2013-06-26 16:00:13 +0000
committerCharles Forsyth <charles.forsyth@gmail.com>2013-06-26 16:00:13 +0000
commit86c8d15162050ac1bbb2de38961263da3a4b1f87 (patch)
tree6fa02ef4435b87d05e7e35ac8fd8ac4d9d05adc6 /libbio
parent5139a0a1c6f3b5a03c2e3eeb56e20a81cda5619a (diff)
use va_copy if defined
Diffstat (limited to 'libbio')
-rw-r--r--libbio/bvprint.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libbio/bvprint.c b/libbio/bvprint.c
index c11b1dc3..15074fb0 100644
--- a/libbio/bvprint.c
+++ b/libbio/bvprint.c
@@ -29,8 +29,15 @@ Bvprint(Biobuf *bp, char *fmt, va_list arg)
f.flush = fmtBflush;
f.farg = bp;
f.nfmt = 0;
+#ifdef va_copy
+ va_copy(f.args, arg);
+#else
f.args = arg;
+#endif
n = dofmt(&f, fmt);
+#ifdef va_copy
+ va_end(f.args);
+#endif
bp->ocount = (char*)f.to - (char*)f.stop;
return n;
}