diff options
Diffstat (limited to 'bftw.c')
-rw-r--r-- | bftw.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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) { |