summaryrefslogtreecommitdiff
path: root/builtin-archive.c
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2007-10-21 11:23:49 +0200
committerShawn O. Pearce <spearce@spearce.org>2007-10-22 00:00:40 -0400
commitc32f749fec69f92ce3b076128e6322f8130bd881 (patch)
tree0ada7de6f324a57dccd4b7bba9eaa05091a252cc /builtin-archive.c
parent5be507fc955bd14643cac1162cfaa592d0e236ba (diff)
downloadgit-c32f749fec69f92ce3b076128e6322f8130bd881.tar.gz
Correct some sizeof(size_t) != sizeof(unsigned long) typing errors
Fix size_t vs. unsigned long pointer mismatch warnings introduced with the addition of strbuf_detach(). Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'builtin-archive.c')
-rw-r--r--builtin-archive.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin-archive.c b/builtin-archive.c
index 04385dea05..6f29c2f40a 100644
--- a/builtin-archive.c
+++ b/builtin-archive.c
@@ -148,12 +148,14 @@ void *sha1_file_to_archive(const char *path, const unsigned char *sha1,
buffer = read_sha1_file(sha1, type, sizep);
if (buffer && S_ISREG(mode)) {
struct strbuf buf;
+ size_t size = 0;
strbuf_init(&buf, 0);
strbuf_attach(&buf, buffer, *sizep, *sizep + 1);
convert_to_working_tree(path, buf.buf, buf.len, &buf);
convert_to_archive(path, buf.buf, buf.len, &buf, commit);
- buffer = strbuf_detach(&buf, sizep);
+ buffer = strbuf_detach(&buf, &size);
+ *sizep = size;
}
return buffer;