]> granicus.if.org Git - php/commitdiff
Clearify
authorMarcus Boerger <helly@php.net>
Fri, 8 Aug 2003 19:48:33 +0000 (19:48 +0000)
committerMarcus Boerger <helly@php.net>
Fri, 8 Aug 2003 19:48:33 +0000 (19:48 +0000)
main/snprintf.c

index bcd14f70361cb6434007638bd6ad24d3eef30c85..80a7a9267c837e2eb18f76ce0f4179552434a462 100644 (file)
@@ -315,14 +315,12 @@ ap_php_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag, char *buf)
                p1 = &buf[NDIG];
                while (fi != 0) {
                        fj = modf(fi / 10, &fi);
-                       if (p1 > &buf[0]) {
-                               *--p1 = (int) ((fj + .03) * 10) + '0';
-                       } else {
+                       if (p1 <= &buf[0]) {
                                mvl = NDIG - ndigits;
                                memmove(&buf[mvl], &buf[0], NDIG-mvl-1);
                                p1 += mvl;
-                               *--p1 = (int) ((fj + .03) * 10) + '0';
                        }
+                       *--p1 = (int) ((fj + .03) * 10) + '0';
                        r2++;
                }
                while (p1 < &buf[NDIG])