Merge pull request #7 from linebender/fix_item_ref

Clear item ref on empty segments
This commit is contained in:
Raph Levien 2020-05-01 19:41:35 -07:00 committed by GitHub
commit 064ee86a45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -119,7 +119,9 @@ void main() {
start = end;
}
if (chunk_n_segs > 0) {
if (chunk_n_segs == 0) {
ItemHeader_write(item_header, ItemHeader(SegChunkRef(0)));
} else {
SegChunk_write(seg_chunk_ref, SegChunk(chunk_n_segs, SegChunkRef(0)));
seg_chunk_ref.offset += SegChunk_size + Segment_size * chunk_n_segs;
}

Binary file not shown.