From f19cccd10f86db3ce5d6174956f440f8fecb7ad6 Mon Sep 17 00:00:00 2001 From: Quinn Date: Thu, 7 Aug 2025 09:57:17 +0200 Subject: [PATCH] fix: the `+` unary operator does not add 1, but just specifies intent. I was very mistaken, and I feel like an idiot. --- src/dat/nbt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dat/nbt.c b/src/dat/nbt.c index 1a6d7bd..95773b9 100644 --- a/src/dat/nbt.c +++ b/src/dat/nbt.c @@ -48,7 +48,7 @@ size_t nbt_tagdatlen(const u8 *restrict buf) { case NBT_ARR_I64: mems += sizeof(i64) - sizeof(i32); __attribute__((fallthrough)); case NBT_ARR_I32: mems += sizeof(i32) - sizeof(i8); __attribute__((fallthrough)); - case NBT_ARR_I8: return +mems * (i32)be32toh(*(u32 *)(buf)) + 4; + case NBT_ARR_I8: return ++mems * (i32)be32toh(*(u32 *)(buf)) + 4; case NBT_STR: return be16toh(*(u16 *)buf) + 2;