diff options
author | Rob Landley <rob@landley.net> | 2020-10-15 15:49:26 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2020-10-15 15:49:26 -0500 |
commit | 85e7f1671c28bb4808b0eb46aab9152ca2bb4bff (patch) | |
tree | 80e0fc3f996edf287db283adb59bac52f1b8677b /lib | |
parent | 6a5b8bf6cb7a5f481c3bab6fb285d977851e4e2f (diff) | |
download | toybox-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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dirtree.c | 2 |
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)); |