summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/sqfs/write_inode.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqfs/write_inode.c b/lib/sqfs/write_inode.c
index e64e6a6..422959e 100644
--- a/lib/sqfs/write_inode.c
+++ b/lib/sqfs/write_inode.c
@@ -63,7 +63,7 @@ int sqfs_meta_writer_write_inode(sqfs_meta_writer_t *ir,
ret = sqfs_meta_writer_append(ir, &file, sizeof(file));
if (ret)
return ret;
- return write_block_sizes(ir, n);
+ return n->num_file_blocks ? write_block_sizes(ir, n) : 0;
}
case SQFS_INODE_SLINK: {
sqfs_inode_slink_t slink = {
@@ -117,7 +117,7 @@ int sqfs_meta_writer_write_inode(sqfs_meta_writer_t *ir,
ret = sqfs_meta_writer_append(ir, &file, sizeof(file));
if (ret)
return ret;
- return write_block_sizes(ir, n);
+ return n->num_file_blocks ? write_block_sizes(ir, n) : 0;
}
case SQFS_INODE_EXT_SLINK: {
sqfs_inode_slink_t slink = {