From ce7d310bd436a7cf3348c66ebc8435920bb4211c Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Tue, 28 Jun 2016 20:57:49 -0500 Subject: [PATCH] Removed root directry entry, because the root directory doesn't need an entry. --- src/ox/fs/filestore.hpp | 2 +- src/ox/fs/filesystem.hpp | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/ox/fs/filestore.hpp b/src/ox/fs/filestore.hpp index f45e2269d..8835ab11f 100644 --- a/src/ox/fs/filestore.hpp +++ b/src/ox/fs/filestore.hpp @@ -377,7 +377,7 @@ uint8_t *FileStore::format(uint8_t *buffer, FsSize_t size) { auto inodeSection = (Inode*) (buffer + header->rootInode); inodeSection->m_id = 0; - inodeSection->next = inodeSection->prev = (uint8_t*) inodeSection - (uint8_t*) buffer; + inodeSection->next = inodeSection->prev = (FsSize_t) ((uint8_t*) inodeSection - (uint8_t*) buffer); return (uint8_t*) header; } diff --git a/src/ox/fs/filesystem.hpp b/src/ox/fs/filesystem.hpp index 7db48ae94..a67b087f3 100644 --- a/src/ox/fs/filesystem.hpp +++ b/src/ox/fs/filesystem.hpp @@ -93,11 +93,8 @@ FileStat FileSystem::stat(typename FileStore::InodeId_t inode) { template uint8_t *FileSystem::format(uint8_t *buffer, typename FileStore::FsSize_t size) { buffer = FileStore::format(buffer, size); - char dirBuff[sizeof(Directory) + sizeof(Directory)]; + char dirBuff[sizeof(Directory) + sizeof(DirectoryEntry) + 2]; auto *dir = (Directory*) dirBuff; - DirectoryEntry entry; - entry.inode = INODE_ROOT_DIR; - entry.setName("/"); if (buffer) { uint32_t err;