From 85e7f1671c28bb4808b0eb46aab9152ca2bb4bff Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 15 Oct 2020 15:49:26 -0500 Subject: 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. --- lib/dirtree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); -- cgit v1.2.3