com php-src: fixed strstr(): ext/standard/string.c

From: Date: Wed, 16 Oct 2013 10:08:26 +0000
Subject: com php-src: fixed strstr(): ext/standard/string.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-73489@lists.php.net to get a copy of this message
Commit: df0a28baabc2ff4e3a5d77cc413635429e38d4fd Author: Anatol Belski <ab@php.net> Sat, 17 Aug 2013 03:53:07 -0700 Parents: c9280f1e1c59c4198c458d8e693dd0f9aa672200 Branches: str_size_and_int64 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=df0a28baabc2ff4e3a5d77cc413635429e38d4fd Log: fixed strstr() Changed paths: M ext/standard/string.c Diff: diff --git a/ext/standard/string.c b/ext/standard/string.c index 75bd5f1..fb09f36 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2999,9 +2999,9 @@ static PPRES *php_strtr_array_prepare(STR *text, PATNREPL *patterns, int patnum, } } res->hash->entries[HASH_TAB_SIZE] = patnum; /* OK, we effectively allocated SIZE+1 */ - for (i = HASH_TAB_SIZE - 1; i >= 0; i--) { - if (res->hash->entries[i] == -1) { - res->hash->entries[i] = res->hash->entries[i + 1]; + for (i = HASH_TAB_SIZE; i > 0; i--) { + if (res->hash->entries[i-1] == -1) { + res->hash->entries[i-1] = res->hash->entries[i]; } }

« previous php.cvs (#73489) next »