mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Reverted 387c491559
(it broke ext/standard/tests/file/bug44607.phpt)
This commit is contained in:
parent
387c491559
commit
9af4b18b81
@ -1581,13 +1581,15 @@ ZEND_API int concat_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{
|
|||||||
|
|
||||||
Z_STR_P(result) = STR_REALLOC(Z_STR_P(result), res_len, 0 );
|
Z_STR_P(result) = STR_REALLOC(Z_STR_P(result), res_len, 0 );
|
||||||
Z_TYPE_INFO_P(result) = IS_STRING_EX;
|
Z_TYPE_INFO_P(result) = IS_STRING_EX;
|
||||||
memcpy(Z_STRVAL_P(result) + op1_len, Z_STRVAL_P(op2), op2_len + 1);
|
memcpy(Z_STRVAL_P(result) + op1_len, Z_STRVAL_P(op2), op2_len);
|
||||||
|
Z_STRVAL_P(result)[res_len]=0;
|
||||||
} else {
|
} else {
|
||||||
int length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2);
|
int length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2);
|
||||||
zend_string *buf = STR_ALLOC(length, 0);
|
zend_string *buf = STR_ALLOC(length, 0);
|
||||||
|
|
||||||
memcpy(buf->val, Z_STRVAL_P(op1), Z_STRLEN_P(op1));
|
memcpy(buf->val, Z_STRVAL_P(op1), Z_STRLEN_P(op1));
|
||||||
memcpy(buf->val + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2) + 1);
|
memcpy(buf->val + Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2));
|
||||||
|
buf->val[length] = 0;
|
||||||
ZVAL_NEW_STR(result, buf);
|
ZVAL_NEW_STR(result, buf);
|
||||||
}
|
}
|
||||||
if (use_copy1) {
|
if (use_copy1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user