aboutsummaryrefslogtreecommitdiff
path: root/unpack
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-04 01:18:27 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-04 01:18:27 +0200
commitbf1dd4f1ab8ef70f96704c4e2bd95968e1615b37 (patch)
tree807ca034531c8470c5128642be118352dbbf8775 /unpack
parent85e2e1629ba43ea2b2a11b1f81e3538e3cea64da (diff)
Fix functions with side effect being used inside asserts
If -DNDEBUG is set, the entire thing is omitted from the output. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'unpack')
-rw-r--r--unpack/restore_fstree.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/unpack/restore_fstree.c b/unpack/restore_fstree.c
index 7fe074e..5681e0a 100644
--- a/unpack/restore_fstree.c
+++ b/unpack/restore_fstree.c
@@ -9,8 +9,8 @@
static int create_node(tree_node_t *n, int flags)
{
tree_node_t *c;
+ int fd, ret;
char *name;
- int fd;
if (!(flags & UNPACK_QUIET)) {
name = fstree_get_path(n);
@@ -82,7 +82,8 @@ static int create_node(tree_node_t *n, int flags)
return -1;
}
- assert(canonicalize_name(n->data.file->input_file) == 0);
+ ret = canonicalize_name(n->data.file->input_file);
+ assert(ret == 0);
break;
default:
break;