]> granicus.if.org Git - icu/commitdiff
ICU-13368 Responding to Markus code review feedback on r40528.
authorShane Carr <shane@unicode.org>
Thu, 5 Oct 2017 01:32:05 +0000 (01:32 +0000)
committerShane Carr <shane@unicode.org>
Thu, 5 Oct 2017 01:32:05 +0000 (01:32 +0000)
X-SVN-Rev: 40563

icu4c/source/common/ucurr.cpp

index df5d973a88c586429317f243910a0ebfabef62a2..b7b00cbcebf29e4e03aa2329da889a6fbe705963 100644 (file)
@@ -653,17 +653,13 @@ static UBool fallback(char *loc) {
         return FALSE;
     }
     UErrorCode status = U_ZERO_ERROR;
-    static const char en_GB[] = { u'e', u'n', u'_', u'G', u'B', 0 };
-    if (uprv_strcmp(loc, en_GB) == 0) {
+    if (uprv_strcmp(loc, "en_GB") == 0) {
         // HACK: See #13368.  We need "en_GB" to fall back to "en_001" instead of "en"
         // in order to consume the correct data strings.  This hack will be removed
         // when proper data sink loading is implemented here.
         // NOTE: "001" adds 1 char over "GB".  However, both call sites allocate
         // arrays with length ULOC_FULLNAME_CAPACITY (plenty of room for en_001).
-        loc[3] = u'0';
-        loc[4] = u'0';
-        loc[5] = u'1';
-        loc[6] = 0;
+        uprv_strcpy(loc + 3, "001");
     } else {
         uloc_getParent(loc, loc, (int32_t)uprv_strlen(loc), &status);
     }