From 97270f4e75d0b96edddf227acbc0f3d2765a6fa5 Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Fri, 17 Nov 2006 16:45:28 +0000 Subject: [PATCH] Use u_memcpy() instead of memcpy(). --- ext/standard/string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/string.c b/ext/standard/string.c index 4d02361cf8..6c2ac0e9a4 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -3926,7 +3926,7 @@ PHPAPI UChar *php_u_strtr(UChar *str, int len, UChar *str_from, int str_from_len Z_USTRVAL_P(entry)[to_cp_offset - prev_to_offset] = 0; key_string = eumalloc(from_cp_offset - prev_from_offset + 1); - memcpy(key_string, str_from + prev_from_offset, UBYTES(from_cp_offset - prev_from_offset)); + u_memcpy(key_string, str_from + prev_from_offset, from_cp_offset - prev_from_offset); key_string[from_cp_offset - prev_from_offset] = 0; zend_u_hash_add(tmp_hash, IS_UNICODE, ZSTR(key_string), from_cp_offset - prev_from_offset + 1, &entry, sizeof(zval*), NULL); @@ -4020,7 +4020,7 @@ static UChar* php_u_strtr_array(UChar *str, int slen, HashTable *hash, int minle } found = 0; - memcpy(key, str+pos, UBYTES(maxlen)); + u_memcpy(key, str+pos, maxlen); for (len = maxlen; len >= minlen; len--) { key[len] = 0; -- 2.40.0