From 186420eccf901499b2503548e0cd51c76f781954 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Fri, 7 May 2004 21:00:41 +0000 Subject: 2004-05-07 Artem B. Bityuckiy * libc/stdio/iprintf.c (_iprintf_r): Fix old-style argument list for reentrant pointer. Call _vfiprintf_r. * libc/stdio/siprintf.c (_siprintf_r): New function. * libc/stdio/vfprintf.c (__sbprintf): Add reetrant struct pointer argument. Change all callers. Call _VFPRINTF_R. * libc/include/stdio.h (_siprintf_r, _vfiprintf_r): New prototypes. --- newlib/libc/stdio/vfprintf.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'newlib/libc/stdio/vfprintf.c') diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c index b72117582..906934787 100644 --- a/newlib/libc/stdio/vfprintf.c +++ b/newlib/libc/stdio/vfprintf.c @@ -233,8 +233,9 @@ _DEFUN(__sprint, (fp, uio), * worries about ungetc buffers and so forth. */ static int -_DEFUN(__sbprintf, (fp, fmt, ap), - register FILE *fp _AND +_DEFUN(__sbprintf, (rptr, fp, fmt, ap), + struct _reent *rptr _AND + register FILE *fp _AND _CONST char *fmt _AND va_list ap) { @@ -257,7 +258,7 @@ _DEFUN(__sbprintf, (fp, fmt, ap), #endif /* do the work, then copy any error status */ - ret = VFPRINTF (&fake, fmt, ap); + ret = _VFPRINTF_R (rptr, &fake, fmt, ap); if (ret >= 0 && fflush(&fake)) ret = EOF; if (fake._flags & __SERR) @@ -541,7 +542,7 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap), /* optimise fprintf(stderr) (and other unbuffered Unix files) */ if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) && fp->_file >= 0) - return (__sbprintf (fp, fmt0, ap)); + return (__sbprintf (data, fp, fmt0, ap)); fmt = (char *)fmt0; uio.uio_iov = iovp = iov; -- cgit v1.2.3