mirror of
https://github.com/php/php-src.git
synced 2026-04-29 11:13:36 +02:00
Fixed a bug in the new implementation of str_repeat()
This commit is contained in:
@@ -3582,8 +3582,8 @@ PHP_FUNCTION(str_repeat)
|
||||
result_len = Z_STRLEN_PP(input_str) * Z_LVAL_PP(mult);
|
||||
result = (char *)emalloc(result_len + 1);
|
||||
|
||||
/* Heavy optimization for situations where multiplier is 1 byte long */
|
||||
if (Z_LVAL_PP(mult) == 1) {
|
||||
/* Heavy optimization for situations where input string is 1 byte long */
|
||||
if (Z_STRLEN_PP(input_str) == 1) {
|
||||
memset(result, *(Z_STRVAL_PP(input_str)), Z_LVAL_PP(mult));
|
||||
} else {
|
||||
char *s, *e, *ee;
|
||||
|
||||
Reference in New Issue
Block a user