diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-28 22:35:24 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-28 22:36:00 +0200 |
commit | d677b30e9408e149693c66869d6111fe48819e86 (patch) | |
tree | 08a995b9374fdf11e07a5a30209cc85c813e1692 | |
parent | 4134c45857a98730b68845f3025c7ac582c1c72b (diff) |
Fix dir writer size accounting
Count the *corrent* entry structure size, i.e. the on-disk one, not the
in-memory one.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r-- | lib/sqfs/dir_writer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqfs/dir_writer.c b/lib/sqfs/dir_writer.c index ffe14f4..7c2d30d 100644 --- a/lib/sqfs/dir_writer.c +++ b/lib/sqfs/dir_writer.c @@ -145,7 +145,6 @@ int sqfs_dir_writer_add_entry(sqfs_dir_writer_t *writer, const char *name, writer->list_end = ent; } - writer->dir_size += sizeof(ent) + ent->name_len; writer->ent_count += 1; return 0; } @@ -255,6 +254,7 @@ int sqfs_dir_writer_end(sqfs_dir_writer_t *writer) if (err) return err; + writer->dir_size += sizeof(ent) + it->name_len; it = it->next; } } |