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 Apr 23, 2023
1 parent 90560b2 commit 6e36df6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions locale.c
Original file line number Diff line number Diff line change
Expand Up @@ -1858,6 +1858,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 6e36df6

Please sign in to comment.