Author: eadler
Date: Fri Dec 29 14:56:46 2017
New Revision: 327343
URL: https://svnweb.freebsd.org/changeset/base/327343

Log:
  libc/locale: fix an off-by-one in newlocale
  
  Reported by:  z...@dragonflybsd.org

Modified:
  head/lib/libc/locale/xlocale.c

Modified: head/lib/libc/locale/xlocale.c
==============================================================================
--- head/lib/libc/locale/xlocale.c      Fri Dec 29 14:31:43 2017        
(r327342)
+++ head/lib/libc/locale/xlocale.c      Fri Dec 29 14:56:46 2017        
(r327343)
@@ -275,7 +275,7 @@ locale_t newlocale(int mask, const char *locale, local
        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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to