]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - locale/broken_cur_max.c
Replace = with += in CFLAGS-xxx.c/CPPFLAGS-xxx.c
[thirdparty/glibc.git] / locale / broken_cur_max.c
index c997bec1635272e8a793d3e42c53b1e90ef4d17e..1f849c3e9a388cb01bb34b1fcd19b9ac0da949c4 100644 (file)
@@ -1,6 +1,6 @@
 /* Return number of characters in multibyte representation for current
    character set.
-   Copyright (C) 1996, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1996-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -15,9 +15,8 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #include <langinfo.h>
 #include <locale.h>
@@ -44,7 +43,8 @@
 size_t
 __ctype_get_mb_cur_max (void)
 {
-  size_t correct_value = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MB_CUR_MAX);
+  union locale_data_value u;
 
-  return ((size_t []) { 1, 1, 1, 2, 2, 3, 4 })[correct_value];
+  u.string = nl_langinfo (_NL_CTYPE_MB_CUR_MAX);
+  return ((size_t []) { 1, 1, 1, 2, 2, 3, 4 })[u.word];
 }