From 8df2a5ebc7ff6a54622c3d0ee27e09afc46332c2 Mon Sep 17 00:00:00 2001 From: synqa Date: Tue, 24 Feb 2026 11:16:19 +0900 Subject: [PATCH] Fix hamcore building with incorrect file size HamcoreBuild was creating files lager than their actual size. This occurred because buffer_size referred to the size of the buffer allocated during compression, rather than the actual file size(offset). Fix this by specifying the correct file size during the write process. --- Hamcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Hamcore.c b/Hamcore.c index 9689a2d..ffb4868 100644 --- a/Hamcore.c +++ b/Hamcore.c @@ -389,7 +389,7 @@ bool HamcoreBuild(const char *dst_path, const char *base_path, const char **src_ goto FINAL; } - if (!Ham_FileWrite(handle, buffer, buffer_size)) + if (!Ham_FileWrite(handle, buffer, offset)) { fprintf(stderr, "HamcoreBuild(): Failed to write \"%s\"!\n", dst_path); goto FINAL;