Skip to content

Commit

Permalink
locale.c: Move unreachable code
Browse files Browse the repository at this point in the history
It turns out this code, setting errno, is unreachable.  Move it to the
place where it would do some good, removing an extraneous, unreachable
return;
  • Loading branch information
khwilliamson committed May 6, 2021
1 parent 443f76d commit bd00f6f
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions locale.c
Expand Up @@ -342,6 +342,12 @@ S_get_category_index(const int category, const char * locale)
"Unknown locale category %d%s%s",
category, conditional_warn_text, locale);

# ifdef EINVAL

SETERRNO(EINVAL, LIB_INVARG);

# endif

/* Return an out-of-bounds value */
return NOMINAL_LC_ALL_INDEX + 1;
}
Expand Down Expand Up @@ -660,14 +666,6 @@ S_emulate_setlocale_i(pTHX_ const unsigned int index, const char * locale)
return all_string;
}

# ifdef EINVAL

SETERRNO(EINVAL, LIB_INVARG);

# endif

return NULL;

# endif

} /* End of this being setlocale(LC_foo, NULL) */
Expand Down

0 comments on commit bd00f6f

Please sign in to comment.