Proper MB_CUR_MAX.
Previously this was hard coded to 4. This is only the case for UTF-8 locales. As a side effect, this properly reports C.UTF-8 as the default locale instead of C. Change-Id: I7c73cc8fe6ffac61d211cd5f75287e36de06f4fc
This commit is contained in:
@@ -427,6 +427,9 @@ TEST(stdio, snprintf_negative_zero_5084292) {
|
||||
}
|
||||
|
||||
TEST(stdio, snprintf_utf8_15439554) {
|
||||
locale_t cloc = newlocale(LC_ALL, "C.UTF-8", 0);
|
||||
uselocale(cloc);
|
||||
|
||||
// http://b/15439554
|
||||
char buf[BUFSIZ];
|
||||
|
||||
@@ -442,6 +445,8 @@ TEST(stdio, snprintf_utf8_15439554) {
|
||||
// 4-byte character.
|
||||
snprintf(buf, sizeof(buf), "%d\xf0\xa4\xad\xa2%d", 1, 2);
|
||||
EXPECT_STREQ("1𤭢2", buf);
|
||||
|
||||
freelocale(cloc);
|
||||
}
|
||||
|
||||
TEST(stdio, fprintf_failures_7229520) {
|
||||
|
Reference in New Issue
Block a user