From 984e353160593b20d1e2944e1f2e9ce2117c8490 Mon Sep 17 00:00:00 2001 From: rsc Date: Sun, 22 Aug 2004 15:39:56 +0000 Subject: PowerPC Linux support from ericvh. Mainly adding va_copy/va_end. Also fix bug in sprint wrapping around top of memory. --- src/lib9/fmt/fmtvprint.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/lib9/fmt/fmtvprint.c') diff --git a/src/lib9/fmt/fmtvprint.c b/src/lib9/fmt/fmtvprint.c index 6aed013d..60974a0b 100644 --- a/src/lib9/fmt/fmtvprint.c +++ b/src/lib9/fmt/fmtvprint.c @@ -32,13 +32,15 @@ fmtvprint(Fmt *f, char *fmt, va_list args) f->flags = 0; f->width = 0; f->prec = 0; - va = f->args; - f->args = args; + va_copy(va,f->args); + va_copy(f->args,args); n = dofmt(f, fmt); f->flags = 0; f->width = 0; f->prec = 0; - f->args = va; + va_end(f->args); + va_copy(f->args,va); + va_end(va); if(n >= 0) return 0; return n; -- cgit v1.2.3