com php-src: Replace always true condition with ZEND_ASSERT (): ext/standard/math.c
| From: | Dmitry Stogov | Date: | Thu, 30 Nov 2017 11:54:11 +0000 |
| Subject: | com php-src: Replace always true condition with ZEND_ASSERT (): ext/standard/math.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-100450@lists.php.net to get a copy of this message | ||
Commit: 6d736aa400958413742a556dc0b973ad66392b8b
Author: Dmitry Stogov <dmitry@zend.com> Thu, 30 Nov 2017 14:54:11 +0300
Parents: a415006b5e9735dc9e731816ca0ef18e26402fdf
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6d736aa400958413742a556dc0b973ad66392b8b
Log:
Replace always true condition with ZEND_ASSERT()
Changed paths:
M ext/standard/math.c
Diff:
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 8285ede..ed36782 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -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);
}