]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/locbased.cpp
ICU-59131.0.1.tar.gz
[apple/icu.git] / icuSources / common / locbased.cpp
index b3d911d0edc1a66b2471fe95e5ad6fba5f1f6dee..ff378b4cc78f1d171131ab80386dcaa2b94759fe 100644 (file)
@@ -1,3 +1,5 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 **********************************************************************
 * Copyright (c) 2004-2014, International Business Machines
@@ -36,10 +38,12 @@ const char* LocaleBased::getLocaleID(ULocDataLocaleType type, UErrorCode& status
 
 void LocaleBased::setLocaleIDs(const char* validID, const char* actualID) {
     if (validID != 0) {
-        uprv_strcpy(valid, validID);
+      uprv_strncpy(valid, validID, ULOC_FULLNAME_CAPACITY);
+      valid[ULOC_FULLNAME_CAPACITY-1] = 0; // always terminate
     }
     if (actualID != 0) {
-        uprv_strcpy(actual, actualID);
+      uprv_strncpy(actual, actualID, ULOC_FULLNAME_CAPACITY);
+      actual[ULOC_FULLNAME_CAPACITY-1] = 0; // always terminate
     }
 }