From: Ilia Alshanetsky Date: Thu, 13 Feb 2003 17:26:02 +0000 (+0000) Subject: MFH X-Git-Tag: php-4.3.2RC1~228 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c2187f4f176437e0191a9ea897addec8225fb7b2;p=php MFH --- diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index 84c96d2751..7343a3aee8 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -359,8 +359,12 @@ php_sprintf_appenddouble(char **buffer, int *pos, numbuf[i++] = fmt; exp_p = php_convert_to_decimal(decpt, 0, &dec2, &sign, 0); numbuf[i++] = sign ? '-' : '+'; - while (*exp_p) { - numbuf[i++] = *(exp_p++); + if (*exp_p) { + while (*exp_p) { + numbuf[i++] = *(exp_p++); + } + } else { + numbuf[i++] = '0'; } } else { numbuf[i++] = cvt[j++];