aboutsummaryrefslogtreecommitdiff
path: root/mctypes.c
diff options
context:
space:
mode:
authorPlex <thinkplex@riseup.net>2021-10-24 23:49:00 +0200
committerPlex <thinkplex@riseup.net>2021-10-24 23:49:00 +0200
commita5099fdeec6f5e45d88108e28e7c00aa1cf3573c (patch)
tree5298b6ab774831304bab218d58a9ca25f332fb35 /mctypes.c
parentd937614705989b9e71c366e5fe61751ba0d1a2eb (diff)
forgot to strip most significant bytes from read
Diffstat (limited to 'mctypes.c')
-rw-r--r--mctypes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mctypes.c b/mctypes.c
index 10d083d..6afa230 100644
--- a/mctypes.c
+++ b/mctypes.c
@@ -40,7 +40,7 @@ int readVarInt(varint x)
unsigned int res = 0;
do {
if(offset == 5) exit(EXIT_FAILURE);
- res |= x[offset] << offset*7;
+ res |= (x[offset] & 0b01111111) << offset*7;
offset++;
} while ((x[offset-1] & 0b10000000) != 0);
return (int) res;