From d677b30e9408e149693c66869d6111fe48819e86 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sat, 28 Sep 2019 22:35:24 +0200 Subject: 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 --- lib/sqfs/dir_writer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqfs') 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; } } -- cgit v1.2.3