summaryrefslogtreecommitdiffstats
path: root/bftw.c
diff options
context:
space:
mode:
Diffstat (limited to 'bftw.c')
-rw-r--r--bftw.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/bftw.c b/bftw.c
index f934f91..7ad36a6 100644
--- a/bftw.c
+++ b/bftw.c
@@ -244,7 +244,7 @@ static void dircache_pop(struct dircache *cache, struct dircache_entry *entry) {
/** Add an entry to the dircache. */
static struct dircache_entry *dircache_add(struct dircache *cache, struct dircache_entry *parent, const char *name) {
size_t namelen = strlen(name);
- size_t size = sizeof(struct dircache_entry) + namelen + 1;
+ size_t size = sizeof(struct dircache_entry) + namelen;
bool needs_slash = false;
if (namelen == 0 || name[namelen - 1] != '/') {
@@ -274,7 +274,6 @@ static struct dircache_entry *dircache_add(struct dircache *cache, struct dircac
if (needs_slash) {
entry->name[namelen++] = '/';
}
- entry->name[namelen] = '\0';
entry->namelen = namelen;
while (parent) {