aboutsummaryrefslogtreecommitdiff
path: root/lib
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 /lib
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 'lib')
-rw-r--r--lib/fstree/fstree_from_dir.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/fstree/fstree_from_dir.c b/lib/fstree/fstree_from_dir.c
index 9066809..a216226 100644
--- a/lib/fstree/fstree_from_dir.c
+++ b/lib/fstree/fstree_from_dir.c
@@ -22,6 +22,7 @@
static char *get_file_path(tree_node_t *n, const char *name)
{
char *ptr, *new;
+ int ret;
if (n->parent == NULL) {
ptr = strdup(name);
@@ -34,7 +35,8 @@ static char *get_file_path(tree_node_t *n, const char *name)
if (ptr == NULL)
goto fail;
- assert(canonicalize_name(ptr) == 0);
+ ret = canonicalize_name(ptr);
+ assert(ret == 0);
new = realloc(ptr, strlen(ptr) + strlen(name) + 2);
if (new == NULL)