From 5faf4c8b8060bbaaddf24546d02815791971b067 Mon Sep 17 00:00:00 2001 From: Vito Gamberini Date: Wed, 22 Jul 2020 08:33:05 -0400 Subject: [PATCH] Fixed bug in size_varint/varlong --- src/datautils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/datautils.c b/src/datautils.c index 2511aea..ddf3fe6 100644 --- a/src/datautils.c +++ b/src/datautils.c @@ -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; @@ -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;