Fix pre-L MB_CUR_MAX.
The default locale is POSIX, not C.UTF-8. POSIX explicitly states
that MB_CUR_MAX is 1 for the POSIX locale:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdlib.h.html
Test: Made change in the NDK, built libc++ against it, ran NDK libc++
tests.
Bug: None
Change-Id: Ic2f6f96aa4a7f20d619030f41323831d01002715
diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h
index eefee13..bf25160 100644
--- a/libc/include/stdlib.h
+++ b/libc/include/stdlib.h
@@ -158,10 +158,11 @@
#define MB_CUR_MAX __ctype_get_mb_cur_max()
#else
/*
- * 4 is only true for UTF-8 locales, but that's what we default to. We'll need
- * the NDK compatibility library to fix this properly.
+ * Pre-L we didn't have any locale support and so we were always the POSIX
+ * locale. POSIX specifies that MB_CUR_MAX for the POSIX locale is 1:
+ * http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdlib.h.html
*/
-#define MB_CUR_MAX 4
+#define MB_CUR_MAX 1
#endif
#if defined(__BIONIC_FORTIFY)