From 369d59c20b0ac020f0a9d9d48953c3d03370fe89 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 12 Aug 2005 13:41:15 +0000 Subject: [PATCH] Fixed str_repeat() bug --- ext/standard/string.c | 6 +++--- 1 file 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); } } } -- 2.50.1