Skip to content

Commit

Permalink
zip: use GIT_SHA1_HEXSZ for trailers
Browse files Browse the repository at this point in the history
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
bk2204 authored and gitster committed Mar 14, 2015
1 parent 1360967 commit aeecdcd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions archive-zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,12 +427,12 @@ static void write_zip_trailer(const unsigned char *sha1)
copy_le16(trailer.entries, zip_dir_entries);
copy_le32(trailer.size, zip_dir_offset);
copy_le32(trailer.offset, zip_offset);
copy_le16(trailer.comment_length, sha1 ? 40 : 0);
copy_le16(trailer.comment_length, sha1 ? GIT_SHA1_HEXSZ : 0);

write_or_die(1, zip_dir, zip_dir_offset);
write_or_die(1, &trailer, ZIP_DIR_TRAILER_SIZE);
if (sha1)
write_or_die(1, sha1_to_hex(sha1), 40);
write_or_die(1, sha1_to_hex(sha1), GIT_SHA1_HEXSZ);
}

static void dos_time(time_t *time, int *dos_date, int *dos_time)
Expand Down

0 comments on commit aeecdcd

Please sign in to comment.