From bf1dd4f1ab8ef70f96704c4e2bd95968e1615b37 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 4 Aug 2019 01:18:27 +0200 Subject: 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 --- unpack/restore_fstree.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'unpack') 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; -- cgit v1.2.3