X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=sha1_file.c;h=6d6073da85d297b4b0a59c0548720b21fc23129d;hb=f5ab6ccae3063725e0a6bfacffaffb245d6df83c;hp=7cfd43c51ba20ee85fe6056c67bbc88cc90dad81;hpb=95fc75129acf14d980bdd56b9b2ee74190f81d91;p=git.git diff --git a/sha1_file.c b/sha1_file.c index 7cfd43c5..6d6073da 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -266,7 +266,7 @@ static char *find_sha1_file(const unsigned char *sha1, struct stat *st) return NULL; } -int check_sha1_signature(unsigned char *sha1, void *map, unsigned long size, const char *type) +int check_sha1_signature(const unsigned char *sha1, void *map, unsigned long size, const char *type) { char header[100]; unsigned char real_sha1[20]; @@ -332,7 +332,7 @@ int unpack_sha1_header(z_stream *stream, void *map, unsigned long mapsize, void void *unpack_sha1_rest(z_stream *stream, void *buffer, unsigned long size) { int bytes = strlen(buffer) + 1; - char *buf = xmalloc(1+size); + unsigned char *buf = xmalloc(1+size); memcpy(buf, buffer + bytes, stream->total_out - bytes); bytes = stream->total_out - bytes; @@ -472,7 +472,7 @@ int sha1_file_size(const unsigned char *sha1, unsigned long *sizep) * The initial part of the delta starts at delta_data_head + * 20. Borrow code from patch-delta to read the result size. */ - data = hdr + strlen(hdr) + 1 + 20; + data = (unsigned char *)(hdr + strlen(hdr) + 1 + 20); /* Skip over the source size; we are not interested in * it and we cannot verify it because we do not want