Skip to content

Commit

Permalink
Fix up the types in write_sha1_file
Browse files Browse the repository at this point in the history
Use "unsigned long" for the size, like we do everywhere else.
  • Loading branch information
Linus Torvalds committed Apr 25, 2005
1 parent a44c9a5 commit f5b913c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ extern int write_sha1_buffer(const unsigned char *sha1, void *buf, unsigned int
extern void * map_sha1_file(const unsigned char *sha1, unsigned long *size);
extern void * unpack_sha1_file(void *map, unsigned long mapsize, char *type, unsigned long *size);
extern void * read_sha1_file(const unsigned char *sha1, char *type, unsigned long *size);
extern int write_sha1_file(char *buf, unsigned len, const char *type, unsigned char *return_sha1);
extern int write_sha1_file(char *buf, unsigned long len, const char *type, unsigned char *return_sha1);

extern int check_sha1_signature(unsigned char *sha1, void *buf, unsigned long size, const char *type);

Expand Down
4 changes: 2 additions & 2 deletions sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ void *read_tree_with_tree_or_commit_sha1(const unsigned char *sha1,
return buffer;
}

int write_sha1_file(char *buf, unsigned len, const char *type, unsigned char *returnsha1)
int write_sha1_file(char *buf, unsigned long len, const char *type, unsigned char *returnsha1)
{
int size;
char *compressed;
Expand All @@ -243,7 +243,7 @@ int write_sha1_file(char *buf, unsigned len, const char *type, unsigned char *re
int fd, hdrlen;

/* Generate the header */
hdrlen = sprintf(hdr, "%s %d", type, len)+1;
hdrlen = sprintf(hdr, "%s %lu", type, len)+1;

/* Sha1.. */
SHA1_Init(&c);
Expand Down

0 comments on commit f5b913c

Please sign in to comment.