mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
- MFZE1
This commit is contained in:
parent
e2efa0196f
commit
b0970f1421
@ -1014,7 +1014,11 @@ ZEND_API int add_char_to_string(zval *result, zval *op1, zval *op2)
|
||||
ZEND_API int add_string_to_string(zval *result, zval *op1, zval *op2)
|
||||
{
|
||||
int length = op1->value.str.len + op2->value.str.len;
|
||||
result->value.str.val = (char *) erealloc(op1->value.str.val, length+1);
|
||||
if (op1->value.str.val == empty_string) {
|
||||
result->value.str.val = (char *) emalloc(length+1);
|
||||
} else {
|
||||
result->value.str.val = (char *) erealloc(op1->value.str.val, length+1);
|
||||
}
|
||||
memcpy(result->value.str.val+op1->value.str.len, op2->value.str.val, op2->value.str.len);
|
||||
result->value.str.val[length] = 0;
|
||||
result->value.str.len = length;
|
||||
|
Loading…
Reference in New Issue
Block a user