Merge vfprintf.c revision 1.52.

This commit is contained in:
Tim J. Robbins 2003-03-14 08:50:43 +00:00
parent 120b4a9366
commit ce7be15190
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=112229

View file

@ -39,7 +39,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
__FBSDID("FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.51 2003/03/12 20:30:00 das Exp");
__FBSDID("FreeBSD: src/lib/libc/stdio/vfprintf.c,v 1.52 2003/03/14 04:48:09 das Exp");
#endif
__FBSDID("$FreeBSD$");
@ -1507,7 +1507,7 @@ cvt(double value, int ndigits, int flags, char *sign, int *decpt,
/* print trailing zeros */
bp = digits + ndigits;
if (ch == 'f') {
if (*digits == '0' && value)
if ((*digits == '0' || *digits == '\0') && value)
*decpt = -ndigits + 1;
bp += *decpt;
}