Skip to content

Commit

Permalink
Fix error when locale is only 1 character
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkwouter committed Jul 18, 2024
1 parent c08c414 commit d90690f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/TranslationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ std::vector<std::string> TranslationManager::getSystemLanguageList() {
char * locale_c_str = setlocale(LC_ALL, "");
if (locale_c_str != NULL){
std::string locale(locale_c_str);
free(locale_c_str);
if (strlen(locale_c_str) > 1) {
free(locale_c_str);
}

locales.push_back(locale);
if (locale.find(".") != std::string::npos) {
Expand Down

0 comments on commit d90690f

Please sign in to comment.