Skip to content

Commit

Permalink
Fixed bug in size_varint/varlong
Browse files Browse the repository at this point in the history
  • Loading branch information
nickelpro committed Jul 22, 2020
1 parent 3dfb2a4 commit 5faf4c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/datautils.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void free_buffer(mc_buffer buffer) { free(buffer.base); }
// will error if the type is invalid, they can't complete the walk, or max_len
// doesn't have enough room for the calculated size
size_t size_varint(uint32_t varint) {
if(varint < (1 << 8))
if(varint < (1 << 7))
return 1;
if(varint < (1 << 14))
return 2;
Expand Down Expand Up @@ -201,7 +201,7 @@ char *dec_varint(int32_t *dest, char *source) {
// Everything past this point isn't part of ProtoDef, just minecraft

size_t size_varlong(uint64_t varint) {
if(varint < (1 << 8))
if(varint < (1 << 7))
return 1;
if(varint < (1 << 14))
return 2;
Expand Down

0 comments on commit 5faf4c8

Please sign in to comment.