X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=pack-check.c;h=3a62e1b7e40927390e10ae63943596a367ecbf47;hb=8ef1c7c77d3e5950a839d9ae348827fa288a9a11;hp=84ed90d36912fc4ad6589cd2792e85a470418d04;hpb=2acc35b08706234f3762992d431db301ead5797e;p=git.git diff --git a/pack-check.c b/pack-check.c index 84ed90d36..3a62e1b7e 100644 --- a/pack-check.c +++ b/pack-check.c @@ -29,12 +29,12 @@ static int verify_packfile(struct packed_git *p) pack_base = p->pack_base; SHA1_Update(&ctx, pack_base, pack_size - 20); SHA1_Final(sha1, &ctx); - if (memcmp(sha1, index_base + index_size - 40, 20)) - return error("Packfile %s SHA1 mismatch with idx", - p->pack_name); - if (memcmp(sha1, pack_base + pack_size - 20, 20)) + if (memcmp(sha1, (char *) pack_base + pack_size - 20, 20)) return error("Packfile %s SHA1 mismatch with itself", p->pack_name); + if (memcmp(sha1, (char *) index_base + index_size - 40, 20)) + return error("Packfile %s SHA1 mismatch with idx", + p->pack_name); /* Make sure everything reachable from idx is valid. Since we * have verified that nr_objects matches between idx and pack, @@ -135,7 +135,7 @@ int verify_pack(struct packed_git *p, int verbose) SHA1_Init(&ctx); SHA1_Update(&ctx, index_base, index_size - 20); SHA1_Final(sha1, &ctx); - if (memcmp(sha1, index_base + index_size - 20, 20)) + if (memcmp(sha1, (char *) index_base + index_size - 20, 20)) ret = error("Packfile index for %s SHA1 mismatch", p->pack_name);