From ce1f3a7d83d398c4c073e610f9ead4aaff1ae66f Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Fri, 15 Oct 1999 20:36:10 +0000 Subject: Make string copying a little more efficient. --- ext/pcre/php_pcre.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/pcre/php_pcre.c') diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 7a0c42eb0c..d17b493d36 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -587,7 +587,7 @@ static int _preg_do_eval(char *eval_str, char *subject, int *offsets, convert_to_string(&retval); /* Save the return value and its length */ - *result = estrdup(retval.value.str.val); + *result = estrndup(retval.value.str.val, retval.value.str.len); result_len = retval.value.str.len; /* Clean up */ @@ -782,7 +782,7 @@ static char *_php_replace_in_subject(zval *regex, zval *replace, zval **subject) /* If regex is an array */ if (regex->type == IS_ARRAY) { /* Duplicating subject string for repeated replacement */ - subject_value = estrdup((*subject)->value.str.val); + subject_value = estrndup((*subject)->value.str.val, (*subject)->value.str.len); zend_hash_internal_pointer_reset(regex->value.ht); -- cgit v1.2.1