Skip to content

Commit d3e7db2

Browse files
ttaylorrgitster
authored andcommitted
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 bb514de (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent db40e3c commit d3e7db2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/pack-objects.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ static void write_reused_pack_one(struct packed_git *reuse_packfile,
10721072
fixup = find_reused_offset(offset) -
10731073
find_reused_offset(base_offset);
10741074
if (fixup) {
1075-
unsigned char ofs_header[10];
1075+
unsigned char ofs_header[MAX_PACK_OBJECT_HEADER];
10761076
unsigned i, ofs_len;
10771077
off_t ofs = offset - base_offset - fixup;
10781078

0 commit comments

Comments
 (0)