Merge pull request #9 from tree-sitter/signed-unsigned
Correctly cast `name_length`
This commit is contained in:
commit
95500a29f8
|
@ -71,7 +71,7 @@ struct Scanner {
|
||||||
Tag &tag = tags[j];
|
Tag &tag = tags[j];
|
||||||
tag.type = static_cast<TagType>(buffer[i++]);
|
tag.type = static_cast<TagType>(buffer[i++]);
|
||||||
if (tag.type == CUSTOM) {
|
if (tag.type == CUSTOM) {
|
||||||
uint16_t name_length = (uint16_t)buffer[i++];
|
uint16_t name_length = static_cast<uint8_t>(buffer[i++]);
|
||||||
tag.custom_tag_name.assign(&buffer[i], &buffer[i + name_length]);
|
tag.custom_tag_name.assign(&buffer[i], &buffer[i + name_length]);
|
||||||
i += name_length;
|
i += name_length;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue