builtin/pack-objects.c: do not open-code `MAX_PACK_OBJECT_HEADER`
The function `write_reused_pack_one()` defines an header to store the OFS_DELTA header, but uses the constant "10" instead of "MAX_PACK_OBJECT_HEADER" (as is done elsewhere in the same patch, circa bb514de356c (pack-objects: improve partial packfile reuse, 2019-12-18)). Declare the `ofs_header` field to be sized according to `MAX_PACK_OBJECT_HEADER` (which is 10, as defined in "pack.h") instead of the constant 10. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau committed
Aug 27, 2024 at 17:13 UTC
d3e7db2b8285e3ac3e9c28df51eab8237bf9c700
1 file changed
+1
-1
builtin/pack-objects.c
+1
-1
@@ -1072,7 +1072,7 @@ static void write_reused_pack_one(struct packed_git *reuse_packfile,
1072
fixup = find_reused_offset(offset) -
1073
find_reused_offset(base_offset);
1074
if (fixup) {
1075
- unsigned char ofs_header[10];
1075
+ unsigned char ofs_header[MAX_PACK_OBJECT_HEADER];
1076
unsigned i, ofs_len;
1077
off_t ofs = offset - base_offset - fixup;
1078