Skip to content

Commit 45d67dc

Browse files
author
Sriya Pratipati
committed
fixed base_mask to be the correct size
1 parent 86d0cb6 commit 45d67dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libc/src/__support/wchar/character_converter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ int CharacterConverter::push(char8_t utf8_byte) {
4444
/* Since the format is 110xxxxx, 1110xxxx, and 11110xxx for 2, 3, and 4,
4545
we will make the base mask with 7 ones and right shift it as necessary. */
4646
constexpr size_t SIGNIFICANT_BITS = 7;
47-
uint32_t base_mask = mask_trailing_ones<uint32_t, SIGNIFICANT_BITS>();
47+
uint8_t base_mask = mask_trailing_ones<uint8_t, SIGNIFICANT_BITS>();
4848
state->total_bytes = num_ones;
4949
utf8_byte &= (base_mask >> num_ones);
5050
}

0 commit comments

Comments
 (0)