]> git.ipfire.org Git - thirdparty/git.git/commitdiff
archive-zip: widen `zlib_deflate_raw()`'s maxsize local to `size_t`
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Thu, 9 Jul 2026 16:49:35 +0000 (16:49 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 9 Jul 2026 21:55:24 +0000 (14:55 -0700)
Prep for the upcoming `git_deflate_bound()` widening to `size_t`: the
local that catches its return needs to be `size_t` too, otherwise the
widening would introduce a silent Windows narrowing here. No semantic
effect with the current unsigned-long-returning `git_deflate_bound()`
(`size_t == unsigned long` on this caller's platforms today).

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
archive-zip.c

index 97ea8d60d6187b35de7f5fd6ea8bc5c529679bc3..a487d4c04133552f8793482f72d0a43f6f7cefb0 100644 (file)
@@ -206,7 +206,7 @@ static void *zlib_deflate_raw(void *data, unsigned long size,
                              unsigned long *compressed_size)
 {
        git_zstream stream;
-       unsigned long maxsize;
+       size_t maxsize;
        void *buffer;
        int result;