Skip to content

Commit

Permalink
S_bool_setlocale_2008_i: Check for failure return
Browse files Browse the repository at this point in the history
Previously, this would forge ahead; looking at the code it seems it
would fail later on anyway, but it is best to check and fail
immediately.
  • Loading branch information
khwilliamson committed May 6, 2023
1 parent 2eca790 commit 540e603
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions locale.c
Expand Up @@ -1864,6 +1864,10 @@ S_bool_setlocale_2008_i(pTHX_
* happens with setting a locale to "" */
if (strEQ(new_locale, "")) {
new_locale = find_locale_from_environment(index);
if (! new_locale) {
SET_EINVAL;
return false;
}
}

# endif
Expand Down

0 comments on commit 540e603

Please sign in to comment.