]> granicus.if.org Git - php/commitdiff
Replace always true condition with ZEND_ASSERT()
authorDmitry Stogov <dmitry@zend.com>
Thu, 30 Nov 2017 11:54:11 +0000 (14:54 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 30 Nov 2017 11:54:11 +0000 (14:54 +0300)
ext/standard/math.c

index 8285edeeda7dcdb4f33fe5c64a56350f179e013f..ed367823edf6f0d6a0c3b679bbf2494626ce318c 100644 (file)
@@ -929,9 +929,10 @@ PHPAPI zend_string * _php_math_longtobase(zval *arg, int base)
        *ptr = '\0';
 
        do {
+               ZEND_ASSERT(ptr > buf);
                *--ptr = digits[value % base];
                value /= base;
-       } while (ptr > buf && value);
+       } while (value);
 
        return zend_string_init(ptr, end - ptr, 0);
 }