libc/locale: fix an off-by-one in newlocale

Reported by:	zrj@DragonFlyBSD.org
This commit is contained in:
Eitan Adler 2017-12-29 14:56:46 +00:00
parent 96287fcda8
commit 5a51239a71
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=327343

View File

@ -275,7 +275,7 @@ locale_t newlocale(int mask, const char *locale, locale_t base)
for (type=0 ; type<XLC_LAST ; type++) {
if (mask & 1) {
if (useenv) {
realLocale = __get_locale_env(type);
realLocale = __get_locale_env(type + 1);
}
new->components[type] =
constructors[type](realLocale, new);