patch: powerpc vfprintf fix

Jeff Johnston jjohnstn@redhat.com
Tue Jan 18 16:45:00 GMT 2005


Yes, feel free to check it in.  I have made a couple of other changes to 
vfscanf.c as well that might not have been copied there.

-- Jeff J.

Aldy Hernandez wrote:
> Hi Jeff.  Hi folks.
> 
> [Ok, this time with the right address]
> 
> It looks like the PPC vfprintf is suffering from some bit-rot.  The
> patch below fixes printf's of floating point numbers.
> 
> The function vfprintf was passing NULL to _vfprintf_r, which later was
> causing a dereference to a NULL pointer.
> 
> Is this ok?
> 
> 	* libc/machine/powerpc/vfprintf.c: Use _REENT when calling
> 	_VFPRINTF_R.
> 
> Index: libc/machine/powerpc/vfprintf.c
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/machine/powerpc/vfprintf.c,v
> retrieving revision 1.9
> diff -c -p -r1.9 vfprintf.c
> *** libc/machine/powerpc/vfprintf.c	26 May 2004 00:19:14 -0000	1.9
> --- libc/machine/powerpc/vfprintf.c	18 Jan 2005 14:32:43 -0000
> *************** _DEFUN (VFPRINTF, (fp, fmt0, ap),
> *** 322,329 ****
>   	_CONST char *fmt0 _AND
>   	va_list ap)
>   {
> !   CHECK_INIT (fp);
> !   return _VFPRINTF_R (fp->_data, fp, fmt0, ap);
>   }
>   
>   int 
> --- 322,328 ----
>   	_CONST char *fmt0 _AND
>   	va_list ap)
>   {
> !   return _VFPRINTF_R (_REENT, fp, fmt0, ap);
>   }
>   
>   int 



More information about the Newlib mailing list