com php-src: Small improvement with zend_memnstr (tianhe 1986): Zend/zend_operators.h

From: Date: Thu, 12 Oct 2017 08:54:40 +0000
Subject: com php-src: Small improvement with zend_memnstr (tianhe 1986): Zend/zend_operators.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-99719@lists.php.net to get a copy of this message
Commit: 4960c41e1f6345d8f0200b287eeba84117e1b511 Author: Dmitry Stogov <dmitry@zend.com> Thu, 12 Oct 2017 11:54:40 +0300 Parents: cc8a28fb18f86ad85fafe4790af2bc6f61df5601 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4960c41e1f6345d8f0200b287eeba84117e1b511 Log: Small improvement with zend_memnstr (tianhe1986) Changed paths: M Zend/zend_operators.h Diff: diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index b2f5378...4120623 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -172,7 +172,7 @@ zend_memnstr(const char *haystack, const char *needle, size_t needle_len, const while (p <= end) { if ((p = (const char *)memchr(p, *needle, (end-p+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 (#99719) next »