Imported Upstream version 58.1
[platform/upstream/icu.git] / source / i18n / usearch.cpp
index 41639b6..4bb3fc4 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 **********************************************************************
 *   Copyright (C) 2001-2015 IBM and others. All rights reserved.
@@ -222,7 +224,7 @@ inline int32_t * addTouint32_tArray(int32_t    *destination,
         if (U_FAILURE(*status)) {
             return NULL;
         }
-        uprv_memcpy(temp, destination, sizeof(int32_t) * offset);
+        uprv_memcpy(temp, destination, sizeof(int32_t) * (size_t)offset);
         *destinationlength = newlength;
         destination        = temp;
     }
@@ -264,7 +266,7 @@ inline int64_t * addTouint64_tArray(int64_t    *destination,
             return NULL;
         }
 
-        uprv_memcpy(temp, destination, sizeof(int64_t) * offset);
+        uprv_memcpy(temp, destination, sizeof(int64_t) * (size_t)offset);
         *destinationlength = newlength;
         destination        = temp;
     }
@@ -1379,7 +1381,7 @@ inline UChar * addToUCharArray(      UChar      *destination,
         }
     }
     if (source1length != 0) {
-        uprv_memcpy(destination, source1, sizeof(UChar) * source1length);
+        u_memcpy(destination, source1, source1length);
     }
     if (source2length != 0) {
         uprv_memcpy(destination + source1length, source2,