diff options
author | Junio C Hamano <junkio@cox.net> | 2005-06-29 00:32:11 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-29 09:11:38 -0700 |
commit | 3c84974207fb6a98eaa393cd4c3481d8ecdb8ce2 (patch) | |
tree | efc70d4b3da5059ea0eeb6a48791aa6dc1805256 /sha1_file.c | |
parent | [PATCH] assorted delta code cleanup (diff) | |
download | tgif-3c84974207fb6a98eaa393cd4c3481d8ecdb8ce2.tar.xz |
[PATCH] Fixlets on top of Nico's clean-up.
If we prefer 0 as maxsize for diff_delta() to say "unlimited", let's be
consistent about it.
This patch also fixes type mismatch in a call to get_delta_hdr_size()
from packed_delta_info().
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'sha1_file.c')
-rw-r--r-- | sha1_file.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/sha1_file.c b/sha1_file.c index 737ecb4800..fdb8a45c4e 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -598,9 +598,9 @@ static int packed_delta_info(unsigned char *base_sha1, char *type, unsigned long *sizep) { - unsigned char *data; + const unsigned char *data; unsigned char delta_head[64]; - unsigned long data_size, result_size, base_size, verify_base_size; + unsigned long result_size, base_size, verify_base_size; z_stream stream; int st; @@ -609,13 +609,10 @@ static int packed_delta_info(unsigned char *base_sha1, if (sha1_object_info(base_sha1, type, &base_size)) die("cannot get info for delta-pack base"); - data = base_sha1 + 20; - data_size = left - 20; - memset(&stream, 0, sizeof(stream)); - stream.next_in = data; - stream.avail_in = data_size; + data = stream.next_in = base_sha1 + 20; + stream.avail_in = left - 20; stream.next_out = delta_head; stream.avail_out = sizeof(delta_head); |