diff options
author | Xinchen Hui <laruence@gmail.com> | 2016-05-07 00:07:04 -0700 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2016-05-07 00:08:15 -0700 |
commit | 29079f263e38ebf76e2ddbd308e001639eb9e3bf (patch) | |
tree | a027f8730f40567a5f284659cad8b5cd40e4b2e1 /Zend/zend_strtod.c | |
parent | f7439afedaaa4ec15e1940efaa280089714d54cf (diff) | |
download | php-git-29079f263e38ebf76e2ddbd308e001639eb9e3bf.tar.gz |
Strlen cleanup (additions for previous one fix)
Probably compilers will do similar optimization
Diffstat (limited to 'Zend/zend_strtod.c')
-rw-r--r-- | Zend/zend_strtod.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Zend/zend_strtod.c b/Zend/zend_strtod.c index 8a0863261b..889a31685c 100644 --- a/Zend/zend_strtod.c +++ b/Zend/zend_strtod.c @@ -4456,7 +4456,7 @@ ZEND_API double zend_oct_strtod(const char *str, const char **endptr) double value = 0; int any = 0; - if (strlen(str) < 1) { + if (str[0] == '\0') { if (endptr != NULL) { *endptr = str; } @@ -4491,7 +4491,7 @@ ZEND_API double zend_bin_strtod(const char *str, const char **endptr) double value = 0; int any = 0; - if (strlen(str) < 2) { + if (str[0] == '\0' || str[1] == '\0') { if (endptr != NULL) { *endptr = str; } |