Skip to content

Commit aeecdcd

Browse files
bk2204gitster
authored andcommitted
zip: use GIT_SHA1_HEXSZ for trailers
Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1360967 commit aeecdcd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

archive-zip.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,12 +427,12 @@ static void write_zip_trailer(const unsigned char *sha1)
427427
copy_le16(trailer.entries, zip_dir_entries);
428428
copy_le32(trailer.size, zip_dir_offset);
429429
copy_le32(trailer.offset, zip_offset);
430-
copy_le16(trailer.comment_length, sha1 ? 40 : 0);
430+
copy_le16(trailer.comment_length, sha1 ? GIT_SHA1_HEXSZ : 0);
431431

432432
write_or_die(1, zip_dir, zip_dir_offset);
433433
write_or_die(1, &trailer, ZIP_DIR_TRAILER_SIZE);
434434
if (sha1)
435-
write_or_die(1, sha1_to_hex(sha1), 40);
435+
write_or_die(1, sha1_to_hex(sha1), GIT_SHA1_HEXSZ);
436436
}
437437

438438
static void dos_time(time_t *time, int *dos_date, int *dos_time)

0 commit comments

Comments
 (0)