From: Jonathan Dieter Date: Mon, 8 Oct 2018 13:05:00 +0000 (+0100) Subject: Code to create test zchunk file with optional flags X-Git-Tag: archive/raspbian/1.1.9+ds1-1+rpi1~1^2~95 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=cf4d76a6e3882cd3aea012d507020cd714bf563a;p=zchunk.git Code to create test zchunk file with optional flags Signed-off-by: Jonathan Dieter --- diff --git a/src/lib/header.c b/src/lib/header.c index cc402f2..3ebae0a 100644 --- a/src/lib/header.c +++ b/src/lib/header.c @@ -238,7 +238,7 @@ static bool preface_create(zckCtx *zck) { length += zck->hash_type.digest_size; /* Write out flags */ - size_t flags = 0; + size_t flags = 2; if(zck->has_streams) flags &= 1; compint_from_size(header+length, flags, &length); @@ -248,6 +248,11 @@ static bool preface_create(zckCtx *zck) { free(header); return false; } + + compint_from_size(header+length, 15, &length); + header = zrealloc(header, length + 100); + memcpy(header+length, "This is a test\0", 15); + length += 15; compint_from_size(header+length, zck->index_size, &length); /* Shrink header to actual size */