summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2005-08-12 13:41:15 +0000
committerDmitry Stogov <dmitry@php.net>2005-08-12 13:41:15 +0000
commit369d59c20b0ac020f0a9d9d48953c3d03370fe89 (patch)
tree2e178ca344c4057e5b2930568ef60a80a01ad32a
parent239f84c215524561357653ce3c03855d6d4397b9 (diff)
downloadphp-git-369d59c20b0ac020f0a9d9d48953c3d03370fe89.tar.gz
Fixed str_repeat() bug
-rw-r--r--ext/standard/string.c6
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);
}
}
}