com php-src: `memcmp` begins from the second char.: Zend/zend_operators.h

From: Date: Thu, 12 Oct 2017 14:46:26 +0000
Subject: com php-src: `memcmp` begins from the second char.: Zend/zend_operators.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-99726@lists.php.net to get a copy of this message
Commit: e6519cb69da5b0975d646e18ad17cd184771696a Author: tianhe1986 <w1s2j3229@163.com> Thu, 12 Oct 2017 22:46:26 +0800 Parents: eb4342eb141be5a55cf32e4d3a893530564e7ffd Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e6519cb69da5b0975d646e18ad17cd184771696a Log: memcmp begins from the second char. Signed-off-by: tianhe1986 <w1s2j3229@163.com> Changed paths: M Zend/zend_operators.h Diff: diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index 4120623..b6e16c3 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -230,7 +230,7 @@ zend_memnrstr(const char *haystack, const char *needle, size_t needle_len, char do { if ((p = (const char *)zend_memrchr(haystack, *needle, (p - haystack) + 1)) && ne == p[needle_len-1]) { - if (!memcmp(needle, p, needle_len - 1)) { + if (!memcmp(needle + 1, p + 1, needle_len - 2)) { return p; } }

« previous php.cvs (#99726) next »