From e6083a98d8a340cd107329b92825df0bbe7118ae Mon Sep 17 00:00:00 2001 From: kib Date: Mon, 23 Oct 2006 07:25:25 +0000 Subject: Revert the rev. 1.4, it causes breakage on most arches except i386. Remove the const qualifier from ap argument for __v2printf, that induced that breakage, and seems to be the real reason for bad code. ap is modified inside the __v2printf body by va_arg macro. Pointy hat to: kib Approved by: pjd (mentor) --- lib/libc/stdio/xprintf.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lib/libc/stdio') diff --git a/lib/libc/stdio/xprintf.c b/lib/libc/stdio/xprintf.c index 5930135..41ee4ab 100644 --- a/lib/libc/stdio/xprintf.c +++ b/lib/libc/stdio/xprintf.c @@ -261,7 +261,7 @@ static struct { static int -__v2printf(FILE *fp, const char *fmt0, unsigned pct, const va_list ap1) +__v2printf(FILE *fp, const char *fmt0, unsigned pct, va_list ap) { struct printf_info *pi, *pil; const char *fmt; @@ -274,9 +274,7 @@ __v2printf(FILE *fp, const char *fmt0, unsigned pct, const va_list ap1) int ret = 0; int n; struct __printf_io io; - va_list ap; - va_copy(ap, ap1); __printf_init(&io); io.fp = fp; @@ -563,7 +561,6 @@ __v2printf(FILE *fp, const char *fmt0, unsigned pct, const va_list ap1) errx(1, "render[%c] = NULL", *fmt); } __printf_flush(&io); - va_end(ap); return (ret); } -- cgit v1.1