diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2021-03-06 17:35:16 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2021-03-06 22:08:36 +0100 |
commit | acb690df464829f58bc7e29abaab7e07349e8e3a (patch) | |
tree | 0d8484b73a4efa28be8fb4be48bf568bafa9bbf1 /lib/sqfs/xattr/xattr_writer_flush.c | |
parent | 34d2755572b1a6ae73e4143a5b4f97c8ab3d0b0f (diff) |
Cleanup: replace ad-hoc dynamic array in sqfs_xattr_writer_t
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/xattr/xattr_writer_flush.c')
-rw-r--r-- | lib/sqfs/xattr/xattr_writer_flush.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sqfs/xattr/xattr_writer_flush.c b/lib/sqfs/xattr/xattr_writer_flush.c index 92f9be3..85ec724 100644 --- a/lib/sqfs/xattr/xattr_writer_flush.c +++ b/lib/sqfs/xattr/xattr_writer_flush.c @@ -145,15 +145,15 @@ static int write_block_pairs(const sqfs_xattr_writer_t *xwr, const kv_block_desc_t *blk, sqfs_u64 *ool_locations) { - sqfs_u32 key_idx, val_idx; const char *key_str, *value_str; sqfs_s32 diff, total = 0; size_t i, refcount; sqfs_u64 ref; for (i = 0; i < blk->count; ++i) { - key_idx = GET_KEY(xwr->kv_pairs[blk->start + i]); - val_idx = GET_VALUE(xwr->kv_pairs[blk->start + i]); + sqfs_u64 ent = ((sqfs_u64 *)xwr->kv_pairs.data)[blk->start + i]; + sqfs_u32 key_idx = GET_KEY(ent); + sqfs_u32 val_idx = GET_VALUE(ent); key_str = str_table_get_string(&xwr->keys, key_idx); value_str = str_table_get_string(&xwr->values, val_idx); @@ -306,7 +306,7 @@ int sqfs_xattr_writer_flush(const sqfs_xattr_writer_t *xwr, sqfs_file_t *file, size_t i, count; int err; - if (xwr->num_pairs == 0 || xwr->num_blocks == 0) { + if (xwr->kv_pairs.used == 0 || xwr->num_blocks == 0) { super->xattr_id_table_start = 0xFFFFFFFFFFFFFFFFUL; super->flags |= SQFS_FLAG_NO_XATTRS; return 0; |