Skip to content

Commit

Permalink
Avoid signedness warnings in sha1_file.c
Browse files Browse the repository at this point in the history
Very irritating.  But "snprintf()" wants "char *", and zlib wants
"unsigned char *".
  • Loading branch information
Linus Torvalds committed Jul 10, 2005
1 parent d5f1bef commit 0ee19dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ int write_sha1_to_fd(int fd, const unsigned char *sha1)
ssize_t size;
unsigned long objsize;
int posn = 0;
char *buf = map_sha1_file_internal(sha1, &objsize);
void *buf = map_sha1_file_internal(sha1, &objsize);
z_stream stream;
if (!buf) {
unsigned char *unpacked;
Expand All @@ -1240,7 +1240,7 @@ int write_sha1_to_fd(int fd, const unsigned char *sha1)
stream.avail_out = size;

/* First header.. */
stream.next_in = hdr;
stream.next_in = (void *)hdr;
stream.avail_in = hdrlen;
while (deflate(&stream, 0) == Z_OK)
/* nothing */;
Expand Down

0 comments on commit 0ee19dc

Please sign in to comment.