diff --git a/gb.h b/gb.h index c27692d..fd092d3 100644 --- a/gb.h +++ b/gb.h @@ -6894,7 +6894,7 @@ isize gb_utf8_decode(u8 const *str, isize str_len, Rune *codepoint_out) { u8 b1, b2, b3; gbUtf8AcceptRange accept; if (x >= 0xf0) { - Rune mask = (cast(Rune)x >> 31) << 31; + Rune mask = (cast(Rune)x << 31) >> 31; codepoint = (cast(Rune)s0 & (~mask)) | (GB_RUNE_INVALID & mask); width = 1; goto end;