From: Stephen Seo Date: Fri, 18 Apr 2025 07:57:50 +0000 (+0900) Subject: Fix file format 4 archive creation X-Git-Tag: 1.20^2~2 X-Git-Url: https://git.seodisparate.com/stephenseo/js/darkmode.js?a=commitdiff_plain;h=47e40c9447b2c4d37a2ea5218c8812fc96a52ff3;p=SimpleArchiver Fix file format 4 archive creation Previous implementation errored out by mistake when counts were at least 2^32 in size, since file format 4 should support 64-bit (8-byte) counts of file-count-size, chunk-count-size, and directory-count-size. --- diff --git a/src/archiver.c b/src/archiver.c index 80dcb01..63052f0 100644 --- a/src/archiver.c +++ b/src/archiver.c @@ -6237,10 +6237,6 @@ SDArchiverStateRetStruct simple_archiver_write_v4( uint64_t count = 0; for (SDArchiverLLNode *node = chunk_counts->head->next; node != chunk_counts->tail; node = node->next) { - if (*((uint64_t *)node->data) > 0xFFFFFFFF) { - fprintf(stderr, "ERROR: file count in chunk is too large!\n"); - return SDA_RET_STRUCT(SDAS_INTERNAL_ERROR); - } count += *((uint64_t *)node->data); } if (count != files_list->count) { @@ -6780,11 +6776,6 @@ SDArchiverStateRetStruct simple_archiver_write_v4( } // Write directory entries. - - if (dirs_list->count > 0xFFFFFFFF) { - return SDA_RET_STRUCT(SDAS_TOO_MANY_DIRS); - } - u64 = dirs_list->count; if (u64 != 0) { fprintf(stderr, "Directories:\n");