X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fgit.git;a=blobdiff_plain;f=midx.c;fp=midx.c;h=0de42ffdfb22c630e5b28f4997aa558c01a44d79;hp=cc19b6615281475f25cc4119ff2246e2961497fa;hb=9b8074427bd2bb52d0c7ec876ebe0e6834bb69fe;hpb=54e85e7af1ac9e9a92888060d6811ae767fea1bc diff --git a/midx.c b/midx.c index cc19b66152..0de42ffdfb 100644 --- a/midx.c +++ b/midx.c @@ -432,14 +432,11 @@ static size_t write_midx_header(struct hashfile *f, unsigned char num_chunks, uint32_t num_packs) { - unsigned char byte_values[4]; - hashwrite_be32(f, MIDX_SIGNATURE); - byte_values[0] = MIDX_VERSION; - byte_values[1] = oid_version(); - byte_values[2] = num_chunks; - byte_values[3] = 0; /* unused */ - hashwrite(f, byte_values, sizeof(byte_values)); + hashwrite_u8(f, MIDX_VERSION); + hashwrite_u8(f, oid_version()); + hashwrite_u8(f, num_chunks); + hashwrite_u8(f, 0); /* unused */ hashwrite_be32(f, num_packs); return MIDX_HEADER_SIZE;