]> granicus.if.org Git - php/commitdiff
MFB: Fixed bug #37394 (substr_compare() returns an error when offset equals
authorIlia Alshanetsky <iliaa@php.net>
Wed, 10 May 2006 13:07:56 +0000 (13:07 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 10 May 2006 13:07:56 +0000 (13:07 +0000)
string length).

ext/standard/string.c

index 475081ff4113bcdb9dbd04fad078092e16a47829..ea52fcb51a4d364893f4907a372527a32fde59ed 100644 (file)
@@ -6824,7 +6824,7 @@ PHP_FUNCTION(substr_compare)
                offset = (offset < 0) ? 0 : offset;
        }
 
-       if ((offset + len) >= s1_len) {
+       if ((offset + len) > s1_len) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "The start position cannot exceed initial string length");
                RETURN_FALSE;
        }