From: Andrei Zmievski Date: Fri, 17 Nov 2006 16:45:28 +0000 (+0000) Subject: Use u_memcpy() instead of memcpy(). X-Git-Tag: RELEASE_1_0_0RC1~976 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=97270f4e75d0b96edddf227acbc0f3d2765a6fa5;p=php Use u_memcpy() instead of memcpy(). --- 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;