aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2020-10-15 15:49:26 -0500
committerRob Landley <rob@landley.net>2020-10-15 15:49:26 -0500
commit85e7f1671c28bb4808b0eb46aab9152ca2bb4bff (patch)
tree80e0fc3f996edf287db283adb59bac52f1b8677b
parent6a5b8bf6cb7a5f481c3bab6fb285d977851e4e2f (diff)
downloadtoybox-85e7f1671c28bb4808b0eb46aab9152ca2bb4bff.tar.gz
Nitpicky cleanup.
We need to *name = 0 explicitly for the !name && !statless case, so don't need the +1 in memset that was only zeroing in the !name && statless case.
-rw-r--r--lib/dirtree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dirtree.c b/lib/dirtree.c
index 736c2db5..3589933c 100644
--- a/lib/dirtree.c
+++ b/lib/dirtree.c
@@ -53,7 +53,7 @@ struct dirtree *dirtree_add_node(struct dirtree *parent, char *name, int flags)
// Allocate/populate return structure
memset(dt = xmalloc((len = sizeof(struct dirtree)+len+1)+linklen), 0,
- statless ? sizeof(struct dirtree)+1 : offsetof(struct dirtree, st));
+ statless ? sizeof(struct dirtree) : offsetof(struct dirtree, st));
dt->parent = parent;
dt->again = statless ? 2 : 0;
if (!statless) memcpy(&dt->st, &st, sizeof(struct stat));