Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(974)

Unified Diff: source/common/locbased.cpp

Issue 845603002: Update ICU to 54.1 step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: remove unusued directories Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/common/locbased.h ('k') | source/common/locid.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/common/locbased.cpp
diff --git a/source/common/locbased.cpp b/source/common/locbased.cpp
index e96b9f79f3da0f88915eaeacc36b1a7329dee055..ba289621f9a99712b590417570417f8456400414 100644
--- a/source/common/locbased.cpp
+++ b/source/common/locbased.cpp
@@ -1,6 +1,6 @@
/*
**********************************************************************
-* Copyright (c) 2004, International Business Machines
+* Copyright (c) 2004-2014, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Author: Alan Liu
@@ -36,11 +36,18 @@ 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
}
}
+void LocaleBased::setLocaleIDs(const Locale& validID, const Locale& actualID) {
+ uprv_strcpy(valid, validID.getName());
+ uprv_strcpy(actual, actualID.getName());
+}
+
U_NAMESPACE_END
« no previous file with comments | « source/common/locbased.h ('k') | source/common/locid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698