From 40b8c0ef301f1288ec66f2a7d70912eb1ab3e5c9 Mon Sep 17 00:00:00 2001 From: Quinn Date: Sun, 24 Aug 2025 12:51:59 +0200 Subject: [PATCH] write documentation for `nbt_procarr`. --- src/dat/nbt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dat/nbt.c b/src/dat/nbt.c index a10af73..b6ec541 100644 --- a/src/dat/nbt.c +++ b/src/dat/nbt.c @@ -98,6 +98,9 @@ const u8 *nbt_nexttag(const u8 *restrict buf) { return tag; } +/* processes an array at `buf`, of `nmem` items with a size of `size` + * returns a malloc'd pointer (which may be `NULL`) to the data. + * the data is converted from big endian to little endian on little endian systems. */ MALLOC static void *nbt_procarr(const u8 *restrict buf, i32 nmem, uint size) { u8 *ptr = malloc(nmem * size); if (!ptr) return NULL;