If things went perfectly parsed_offset was never updated for the
final entry and we'd seek_set to the start of the last entry. Is
fun when appending to the file next.
Fixes:
2ec1bff0f3a "util/fossilize_db: Split out reading the index."
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12204>
fseek(db_idx, offset, SEEK_SET);
while (offset < len) {
- parsed_offset = offset;
-
char bytes_to_read[FOSSILIZE_BLOB_HASH_LENGTH + sizeof(struct foz_payload_header)];
struct foz_payload_header *header;
_mesa_hash_table_u64_insert(foz_db->index_db, key, entry);
offset += header->payload_size;
+ parsed_offset = offset;
}