Skip to content

Commit f5b913c

Browse files
author
Linus Torvalds
committed
Fix up the types in write_sha1_file
Use "unsigned long" for the size, like we do everywhere else.
1 parent a44c9a5 commit f5b913c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ extern int write_sha1_buffer(const unsigned char *sha1, void *buf, unsigned int
121121
extern void * map_sha1_file(const unsigned char *sha1, unsigned long *size);
122122
extern void * unpack_sha1_file(void *map, unsigned long mapsize, char *type, unsigned long *size);
123123
extern void * read_sha1_file(const unsigned char *sha1, char *type, unsigned long *size);
124-
extern int write_sha1_file(char *buf, unsigned len, const char *type, unsigned char *return_sha1);
124+
extern int write_sha1_file(char *buf, unsigned long len, const char *type, unsigned char *return_sha1);
125125

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

sha1_file.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ void *read_tree_with_tree_or_commit_sha1(const unsigned char *sha1,
231231
return buffer;
232232
}
233233

234-
int write_sha1_file(char *buf, unsigned len, const char *type, unsigned char *returnsha1)
234+
int write_sha1_file(char *buf, unsigned long len, const char *type, unsigned char *returnsha1)
235235
{
236236
int size;
237237
char *compressed;
@@ -243,7 +243,7 @@ int write_sha1_file(char *buf, unsigned len, const char *type, unsigned char *re
243243
int fd, hdrlen;
244244

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

248248
/* Sha1.. */
249249
SHA1_Init(&c);

0 commit comments

Comments
 (0)