Skip to content

Commit

Permalink
fixed segfault with LANG unset
Browse files Browse the repository at this point in the history
  • Loading branch information
MrGlockenspiel committed Oct 23, 2023
1 parent 23c5427 commit c92a692
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/i18n.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ void i18n_set_lang_id(void) {
#undef LANG_STR_SIZE
#else
char *lang = getenv("LANG");
if (!lang) {
printf("LANG env variable unset, defaulting to en_US\n");
lang = "en_US";
}
#endif

__info__("Got user language %s\n", lang);
Expand Down

0 comments on commit c92a692

Please # to comment.