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/fmtprint.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lib9/fmt/fmtprint.c') diff --git a/src/lib9/fmt/fmtprint.c b/src/lib9/fmt/fmtprint.c index fe2ad3cc..c682f49f 100644 --- a/src/lib9/fmt/fmtprint.c +++ b/src/lib9/fmt/fmtprint.c @@ -32,14 +32,15 @@ fmtprint(Fmt *f, char *fmt, ...) f->flags = 0; f->width = 0; f->prec = 0; - va = f->args; + va_copy(va, f->args); va_start(f->args, fmt); n = dofmt(f, fmt); va_end(f->args); f->flags = 0; f->width = 0; f->prec = 0; - f->args = va; + va_copy(f->args,va); + va_end(va); if(n >= 0) return 0; return n; -- cgit v1.2.3