This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Bug in _VFPRINTF_R
- From: Samuel Vinson <samuelv at laposte dot net>
- To: newlib at sourceware dot org
- Date: Fri, 14 Sep 2007 20:50:54 +0200
- Subject: Bug in _VFPRINTF_R
Hi,
I think there is a bug in _VFPRINTF_R (vfprintf.c) in the string case.
The code is :
case 's':
#ifdef _WANT_IO_C99_FORMATS
case 'S':
#endif
sign = '\0';
if ((cp = GET_ARG (N, ap, char_ptr_t)) == NULL) {
cp = "(null)";
size = 6;
}
I think if cp equals NULL, cp just should be empty. The code should be
following :
case 's':
#ifdef _WANT_IO_C99_FORMATS
case 'S':
#endif
sign = '\0';
if ((cp = GET_ARG (N, ap, char_ptr_t)) == NULL) {
cp = "";
size = 0;
}
Thanks
Samuel