]> granicus.if.org Git - php/commitdiff
MFH
authorIlia Alshanetsky <iliaa@php.net>
Thu, 13 Feb 2003 17:26:02 +0000 (17:26 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 13 Feb 2003 17:26:02 +0000 (17:26 +0000)
ext/standard/formatted_print.c

index 84c96d2751e44dd42dc094565204842200c39171..7343a3aee826e23d034872dcbafe08d24cd6966a 100644 (file)
@@ -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++];