diff options
author | Andrei Zmievski <andrei@php.net> | 1999-10-15 20:36:10 +0000 |
---|---|---|
committer | Andrei Zmievski <andrei@php.net> | 1999-10-15 20:36:10 +0000 |
commit | ce1f3a7d83d398c4c073e610f9ead4aaff1ae66f (patch) | |
tree | 07c3e5f195ff62d1ad80cdbb936d00a38df85603 /ext/pcre/php_pcre.c | |
parent | e906d4548abae35ffc701677e2d05a2cb457dd93 (diff) | |
download | php-git-ce1f3a7d83d398c4c073e610f9ead4aaff1ae66f.tar.gz |
Make string copying a little more efficient.
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r-- | ext/pcre/php_pcre.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |