]> granicus.if.org Git - php/commitdiff
Use u_memcpy() instead of memcpy().
authorAndrei Zmievski <andrei@php.net>
Fri, 17 Nov 2006 16:45:28 +0000 (16:45 +0000)
committerAndrei Zmievski <andrei@php.net>
Fri, 17 Nov 2006 16:45:28 +0000 (16:45 +0000)
ext/standard/string.c

index 4d02361cf8730924e32df8421b5f74528f750331..6c2ac0e9a42fed54a767a1345b89f239cd7534d4 100644 (file)
@@ -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;