aboutsummaryrefslogtreecommitdiff
path: root/bin/rdsquashfs
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2022-08-23 20:03:45 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2022-08-23 20:03:45 +0200
commitd807cf258ba7a70ee4607294057701cb7a515c5d (patch)
tree3daad54b9b4d766e03cdb948cc4aff13515816a6 /bin/rdsquashfs
parent7b998c272f99082607ea3af8542a10a64c8d842e (diff)
Check sqfs_tree_node_get_path return value in rdsquashfs error path
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin/rdsquashfs')
-rw-r--r--bin/rdsquashfs/rdsquashfs.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/bin/rdsquashfs/rdsquashfs.c b/bin/rdsquashfs/rdsquashfs.c
index 8926df6..206b754 100644
--- a/bin/rdsquashfs/rdsquashfs.c
+++ b/bin/rdsquashfs/rdsquashfs.c
@@ -72,11 +72,17 @@ static int tree_sort(sqfs_tree_node_t *root)
if (strcmp((const char *)it->name,
(const char *)it->next->name) == 0) {
char *path;
+ int ret;
- sqfs_tree_node_get_path(it, &path);
+ ret = sqfs_tree_node_get_path(it, &path);
- fprintf(stderr, "Entry '%s' found more than once!\n",
- path);
+ if (ret == 0) {
+ fprintf(stderr,
+ "Entry '%s' found more than once!\n",
+ path);
+ } else {
+ fputs("Entry found more than once!\n", stderr);
+ }
sqfs_free(path);
return -1;