diff options
Diffstat (limited to 'thirdparty/icu4c/common/locdispnames.cpp')
-rw-r--r-- | thirdparty/icu4c/common/locdispnames.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/thirdparty/icu4c/common/locdispnames.cpp b/thirdparty/icu4c/common/locdispnames.cpp index 0be069357a..ddf7687a2b 100644 --- a/thirdparty/icu4c/common/locdispnames.cpp +++ b/thirdparty/icu4c/common/locdispnames.cpp @@ -245,7 +245,7 @@ Locale::getDisplayName(const Locale &displayLocale, return result; } -#if ! UCONFIG_NO_BREAK_ITERATION +#if !UCONFIG_NO_BREAK_ITERATION // ------------------------------------- // Gets the objectLocale display name in the default locale language. @@ -351,7 +351,7 @@ _getStringOrCopyKey(const char *path, const char *locale, } } else { /* no string from a resource bundle: convert the substitute */ - length=(int32_t)uprv_strlen(substitute); + length = static_cast<int32_t>(uprv_strlen(substitute)); u_charsToUChars(substitute, dest, uprv_min(length, destCapacity)); errorCode = U_USING_DEFAULT_WARNING; } @@ -835,7 +835,10 @@ uloc_getDisplayKeywordValue( const char* locale, } /* get the keyword value */ - CharString keywordValue = ulocimp_getKeywordValue(locale, keyword, *status); + CharString keywordValue; + if (keyword != nullptr && *keyword != '\0') { + keywordValue = ulocimp_getKeywordValue(locale, keyword, *status); + } /* * if the keyword is equal to currency .. then to get the display name |