diff --git a/libc/bionic/wchar.cpp b/libc/bionic/wchar.cpp index 0ec9504a2..8ffdb9c53 100644 --- a/libc/bionic/wchar.cpp +++ b/libc/bionic/wchar.cpp @@ -72,7 +72,7 @@ size_t mbrtowc(wchar_t* pwc, const char* s, size_t n, mbstate_t*) { // from the first octet, and a mask that extracts the // interesting bits of the first octet. We already know // the character is at least two bytes long. - int length; + size_t length; int mask; // We also specify a lower bound for the character code to @@ -108,7 +108,7 @@ size_t mbrtowc(wchar_t* pwc, const char* s, size_t n, mbstate_t*) { // Decode the octet sequence representing the character in chunks // of 6 bits, most significant first. wchar_t wch = static_cast(*s++) & mask; - int i; + size_t i; for (i = 1; i < MIN(length, n); i++) { if ((*s & 0xc0) != 0x80) { // Malformed input; bad characters in the middle of a character.