summaryrefslogtreecommitdiff
path: root/unpack/list_files.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-22 01:48:50 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-22 02:13:06 +0200
commit57b6a4c855120bc721cd4e76cca32c7b1a382407 (patch)
tree0ee339243e0062cd5543324383e921cfa5273be2 /unpack/list_files.c
parent1bf363ba52025a0cf504b313878ea99c174a1683 (diff)
Add helper functions for working with inodes
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'unpack/list_files.c')
-rw-r--r--unpack/list_files.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/unpack/list_files.c b/unpack/list_files.c
index 11e18cb..ae259bd 100644
--- a/unpack/list_files.c
+++ b/unpack/list_files.c
@@ -87,13 +87,12 @@ static void print_node_size(const sqfs_tree_node_t *n, char *buffer)
case S_IFLNK:
print_size(strlen(n->inode->slink_target), buffer);
break;
- case S_IFREG:
- if (n->inode->base.type == SQFS_INODE_EXT_FILE) {
- print_size(n->inode->data.file_ext.file_size, buffer);
- } else {
- print_size(n->inode->data.file.file_size, buffer);
- }
+ case S_IFREG: {
+ uint64_t size;
+ sqfs_inode_get_file_size(n->inode, &size);
+ print_size(size, buffer);
break;
+ }
case S_IFDIR:
if (n->inode->base.type == SQFS_INODE_EXT_DIR) {
print_size(n->inode->data.dir_ext.size, buffer);