aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2020-10-03 02:34:23 -0500
committerRob Landley <rob@landley.net>2020-10-03 02:34:23 -0500
commit07c316a2bbf0ad0f41229ca668def609a5f50f2c (patch)
treeb213f3a3ac75a5e8b0101a82e109fce181c24de3 /lib
parent424632aaa30e85e069678da8c413a35c4d321cf6 (diff)
downloadtoybox-07c316a2bbf0ad0f41229ca668def609a5f50f2c.tar.gz
Return empty string for dirtree_path() of "" (instead of NULL).
Diffstat (limited to 'lib')
-rw-r--r--lib/dirtree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dirtree.c b/lib/dirtree.c
index 9712ee14..37581829 100644
--- a/lib/dirtree.c
+++ b/lib/dirtree.c
@@ -90,7 +90,7 @@ char *dirtree_path(struct dirtree *node, int *plen)
ll = len = plen ? *plen : 0;
for (nn = node; nn; nn = nn->parent) if (*nn->name) len += strlen(nn->name)+1;
if (plen) *plen = len;
- if (!len) return 0;
+ if (!len) return xstrdup("");
path = xmalloc(len)+len-ll;
for (nn = node; nn; nn = nn->parent) if ((len = strlen(nn->name))) {
*--path = '/'*(nn != node);