From 79cd94d26df33a332586b2aa72a99b123199c88f Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 30 Jun 2020 00:22:25 +0200 Subject: Core/Misc: Changed GetLocaleByName to return invalid value on invalid input instead of LOCALE_enUS * Also added IsValidLocale helper function --- src/common/Common.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common/Common.cpp') diff --git a/src/common/Common.cpp b/src/common/Common.cpp index b768461e274..a176941e6f9 100644 --- a/src/common/Common.cpp +++ b/src/common/Common.cpp @@ -33,11 +33,11 @@ char const* localeNames[TOTAL_LOCALES] = "itIT" }; -LocaleConstant GetLocaleByName(const std::string& name) +LocaleConstant GetLocaleByName(std::string const& name) { for (uint32 i = 0; i < TOTAL_LOCALES; ++i) if (name == localeNames[i]) return LocaleConstant(i); - return LOCALE_enUS; // including enGB case + return TOTAL_LOCALES; } -- cgit v1.2.3