From: Dmitry Stogov Date: Fri, 12 Aug 2005 13:41:15 +0000 (+0000) Subject: Fixed str_repeat() bug X-Git-Tag: PRE_NEW_OCI8_EXTENSION~312 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=369d59c20b0ac020f0a9d9d48953c3d03370fe89;p=php Fixed str_repeat() bug --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 4ae9a65a73..96eedb6fc7 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -4740,13 +4740,13 @@ PHP_FUNCTION(str_repeat) if ( input_str_type == IS_UNICODE ) { *(((UChar *)result)+result_chars-1) = 0; - RETURN_UNICODEL((UChar *)result, result_chars, 0); + RETURN_UNICODEL((UChar *)result, result_chars-1, 0); } else { *(((char *)result)+result_chars-1) = '\0'; if ( input_str_type == IS_BINARY ) { - RETURN_BINARYL((char *)result, result_chars, 0); + RETURN_BINARYL((char *)result, result_chars-1, 0); } else { - RETURN_STRINGL((char *)result, result_chars, 0); + RETURN_STRINGL((char *)result, result_chars-1, 0); } } }