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

From: Date: Sat, 17 Aug 2013 10:53:07 +0000
Subject: com php-src: fixed strstr(): ext/standard/string.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-73624@lists.php.net to get a copy of this message
Commit: 6b067db5fbdc92521e47cf6f05c675b66b671879 Author: Anatol Belski <ab@php.net> Sat, 17 Aug 2013 03:53:07 -0700 Parents: 5c754227a73916dfcb99e0cbe5f5c97d0c68e543 Branches: str_size_and_int64 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6b067db5fbdc92521e47cf6f05c675b66b671879 Log: fixed strstr() Changed paths: M ext/standard/string.c Diff: diff --git a/ext/standard/string.c b/ext/standard/string.c index e6046ae..40d6e6c 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 (#73624) next »