diff options
Diffstat (limited to 'firmware/common/dircache.c')
-rw-r--r-- | firmware/common/dircache.c | 4 |
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) | |||
84 | /* Make sure the entry is long aligned. */ | 84 | /* Make sure the entry is long aligned. */ |
85 | if ((long)next_entry & 0x03) | 85 | if ((long)next_entry & 0x03) |
86 | { | 86 | { |
87 | next_entry = (struct dircache_entry *)(((long)next_entry & ~0x03) + 0x04); | ||
88 | dircache_size += 4 - ((long)next_entry & 0x03); | 87 | dircache_size += 4 - ((long)next_entry & 0x03); |
88 | next_entry = (struct dircache_entry *)(((long)next_entry & ~0x03) + 0x04); | ||
89 | } | 89 | } |
90 | #endif | 90 | #endif |
91 | next_entry->name_len = 0; | 91 | next_entry->name_len = 0; |
@@ -95,7 +95,6 @@ static struct dircache_entry* allocate_entry(void) | |||
95 | next_entry->next = NULL; | 95 | next_entry->next = NULL; |
96 | 96 | ||
97 | dircache_size += sizeof(struct dircache_entry); | 97 | dircache_size += sizeof(struct dircache_entry); |
98 | entry_count++; | ||
99 | 98 | ||
100 | return next_entry; | 99 | return next_entry; |
101 | } | 100 | } |
@@ -186,6 +185,7 @@ static int dircache_scan(struct travel_data *td) | |||
186 | td->ce->wrttime = td->entry.wrttime; | 185 | td->ce->wrttime = td->entry.wrttime; |
187 | memcpy(td->ce->d_name, td->entry.name, td->ce->name_len); | 186 | memcpy(td->ce->d_name, td->entry.name, td->ce->name_len); |
188 | dircache_size += td->ce->name_len; | 187 | dircache_size += td->ce->name_len; |
188 | entry_count++; | ||
189 | 189 | ||
190 | if (td->entry.attr & FAT_ATTR_DIRECTORY) | 190 | if (td->entry.attr & FAT_ATTR_DIRECTORY) |
191 | { | 191 | { |