diff options
-rw-r--r-- | ext/standard/string.c | 6 |
1 files changed, 3 insertions, 3 deletions
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); } } } |