Fixed a bug with unsigned integers being used instead of signed ones
This commit is contained in:
parent
0952d2d60d
commit
e1a0519f5e
|
@ -76,12 +76,12 @@ rune_t rr_extract_utf8(const char *string, usz_t offset, usz_t *increase)
|
|||
if(string[offset] == 0x00)
|
||||
return ZERO;
|
||||
|
||||
usz_t offset_into_rune = rr_distance_to_last_utf8_rune_start(string, offset);
|
||||
isz_t offset_into_rune = rr_distance_to_last_utf8_rune_start(string, offset);
|
||||
if(offset_into_rune < 0)
|
||||
return ZERO;
|
||||
offset -= offset_into_rune;
|
||||
|
||||
usz_t rune_length = rr_identify_utf8_rune_length(string, offset);
|
||||
isz_t rune_length = rr_identify_utf8_rune_length(string, offset);
|
||||
if(rune_length < 0)
|
||||
return ZERO;
|
||||
|
||||
|
|
Loading…
Reference in New Issue