summaryrefslogtreecommitdiffstats
path: root/firmware/common/dircache.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common/dircache.c')
-rw-r--r--firmware/common/dircache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/common/dircache.c b/firmware/common/dircache.c
index 4facbb8ab2..f9fd63b8e4 100644
--- a/firmware/common/dircache.c
+++ b/firmware/common/dircache.c
@@ -84,8 +84,8 @@ static struct dircache_entry* allocate_entry(void)
/* Make sure the entry is long aligned. */
if ((long)next_entry & 0x03)
{
- next_entry = (struct dircache_entry *)(((long)next_entry & ~0x03) + 0x04);
dircache_size += 4 - ((long)next_entry & 0x03);
+ next_entry = (struct dircache_entry *)(((long)next_entry & ~0x03) + 0x04);
}
#endif
next_entry->name_len = 0;
@@ -95,7 +95,6 @@ static struct dircache_entry* allocate_entry(void)
next_entry->next = NULL;
dircache_size += sizeof(struct dircache_entry);
- entry_count++;
return next_entry;
}
@@ -186,6 +185,7 @@ static int dircache_scan(struct travel_data *td)
td->ce->wrttime = td->entry.wrttime;
memcpy(td->ce->d_name, td->entry.name, td->ce->name_len);
dircache_size += td->ce->name_len;
+ entry_count++;
if (td->entry.attr & FAT_ATTR_DIRECTORY)
{