aboutsummaryrefslogtreecommitdiff
path: root/fast-import.c
diff options
context:
space:
mode:
Diffstat (limited to 'fast-import.c')
-rw-r--r--fast-import.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fast-import.c b/fast-import.c
index 87c4e7e40..c4ccb3c9c 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1173,7 +1173,8 @@ static int store_object(
delta_count_by_type[type]++;
e->depth = last->depth + 1;
- hdrlen = encode_in_pack_object_header(OBJ_OFS_DELTA, deltalen, hdr);
+ hdrlen = encode_in_pack_object_header(hdr, sizeof(hdr),
+ OBJ_OFS_DELTA, deltalen);
sha1write(pack_file, hdr, hdrlen);
pack_size += hdrlen;
@@ -1184,7 +1185,8 @@ static int store_object(
pack_size += sizeof(hdr) - pos;
} else {
e->depth = 0;
- hdrlen = encode_in_pack_object_header(type, dat->len, hdr);
+ hdrlen = encode_in_pack_object_header(hdr, sizeof(hdr),
+ type, dat->len);
sha1write(pack_file, hdr, hdrlen);
pack_size += hdrlen;
}
@@ -1246,9 +1248,7 @@ static void stream_blob(uintmax_t len, unsigned char *sha1out, uintmax_t mark)
git_deflate_init(&s, pack_compression_level);
- hdrlen = encode_in_pack_object_header(OBJ_BLOB, len, out_buf);
- if (out_sz <= hdrlen)
- die("impossibly large object header");
+ hdrlen = encode_in_pack_object_header(out_buf, out_sz, OBJ_BLOB, len);
s.next_out = out_buf + hdrlen;
s.avail_out = out_sz - hdrlen;