[Victoria Falls] Fix DirEntry member size
This commit is contained in:
parent
ef1b5ab9a4
commit
3dce058562
|
@ -65,7 +65,7 @@ struct Inode {
|
||||||
|
|
||||||
struct DirEntry {
|
struct DirEntry {
|
||||||
uint32_t inode;
|
uint32_t inode;
|
||||||
uint32_t record_length;
|
uint16_t record_length;
|
||||||
uint8_t name_len;
|
uint8_t name_len;
|
||||||
uint8_t file_type;
|
uint8_t file_type;
|
||||||
char name[256];
|
char name[256];
|
||||||
|
|
|
@ -81,13 +81,13 @@ glcr::ErrorCode Ext2Driver::ProbeDirectory(Inode* inode) {
|
||||||
uint64_t addr = block.vaddr();
|
uint64_t addr = block.vaddr();
|
||||||
while (addr < block.vaddr() + ext2_reader_.BlockSize()) {
|
while (addr < block.vaddr() + ext2_reader_.BlockSize()) {
|
||||||
DirEntry* entry = reinterpret_cast<DirEntry*>(addr);
|
DirEntry* entry = reinterpret_cast<DirEntry*>(addr);
|
||||||
dbgln("Entry: inode: %x, rec_len %x, name_len %x", entry->inode,
|
dbgln("Entry: inode: %x, rec_len %x, name_len %x, file_type: %x",
|
||||||
entry->record_length, entry->name_len);
|
entry->inode, entry->record_length, entry->name_len,
|
||||||
|
entry->file_type);
|
||||||
// FIXME: We need a method to construct a string that is *up to* a certain
|
// FIXME: We need a method to construct a string that is *up to* a certain
|
||||||
// length. As illustrated below the provided name_len is 0x2e but the
|
// length. As illustrated below the provided name_len is 0x2e but the
|
||||||
// first character is \0 since this is the self-referencial inode.
|
// first character is \0 since this is the self-referencial inode.
|
||||||
glcr::String name(entry->name, entry->name_len);
|
glcr::String name(entry->name, entry->name_len);
|
||||||
dbgln("%x, %x", name.length(), glcr::String(entry->name).length());
|
|
||||||
dbgln("%s", name.cstr());
|
dbgln("%s", name.cstr());
|
||||||
addr += entry->record_length;
|
addr += entry->record_length;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue