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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « source/common/locbased.h ('k') | source/common/locid.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ********************************************************************** 2 **********************************************************************
3 * Copyright (c) 2004, International Business Machines 3 * Copyright (c) 2004-2014, International Business Machines
4 * Corporation and others. All Rights Reserved. 4 * Corporation and others. All Rights Reserved.
5 ********************************************************************** 5 **********************************************************************
6 * Author: Alan Liu 6 * Author: Alan Liu
7 * Created: January 16 2004 7 * Created: January 16 2004
8 * Since: ICU 2.8 8 * Since: ICU 2.8
9 ********************************************************************** 9 **********************************************************************
10 */ 10 */
11 #include "locbased.h" 11 #include "locbased.h"
12 #include "cstring.h" 12 #include "cstring.h"
13 13
(...skipping 15 matching lines...) Expand all
29 case ULOC_ACTUAL_LOCALE: 29 case ULOC_ACTUAL_LOCALE:
30 return actual; 30 return actual;
31 default: 31 default:
32 status = U_ILLEGAL_ARGUMENT_ERROR; 32 status = U_ILLEGAL_ARGUMENT_ERROR;
33 return NULL; 33 return NULL;
34 } 34 }
35 } 35 }
36 36
37 void LocaleBased::setLocaleIDs(const char* validID, const char* actualID) { 37 void LocaleBased::setLocaleIDs(const char* validID, const char* actualID) {
38 if (validID != 0) { 38 if (validID != 0) {
39 uprv_strcpy(valid, validID); 39 uprv_strncpy(valid, validID, ULOC_FULLNAME_CAPACITY);
40 valid[ULOC_FULLNAME_CAPACITY-1] = 0; // always terminate
40 } 41 }
41 if (actualID != 0) { 42 if (actualID != 0) {
42 uprv_strcpy(actual, actualID); 43 uprv_strncpy(actual, actualID, ULOC_FULLNAME_CAPACITY);
44 actual[ULOC_FULLNAME_CAPACITY-1] = 0; // always terminate
43 } 45 }
44 } 46 }
45 47
48 void LocaleBased::setLocaleIDs(const Locale& validID, const Locale& actualID) {
49 uprv_strcpy(valid, validID.getName());
50 uprv_strcpy(actual, actualID.getName());
51 }
52
46 U_NAMESPACE_END 53 U_NAMESPACE_END
OLDNEW
« 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