/* 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.
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>
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];
}