Fix FS read by type to read byte by byte
This commit is contained in:
parent
bb5939a663
commit
c971969a73
8
deps/ox/src/ox/fs/filestore.hpp
vendored
8
deps/ox/src/ox/fs/filestore.hpp
vendored
@ -647,9 +647,13 @@ int FileStore<Header>::read(Inode *inode, typename Header::FsSize_t readStart,
|
|||||||
}
|
}
|
||||||
|
|
||||||
readSize /= sizeof(T);
|
readSize /= sizeof(T);
|
||||||
T *it = (T*) &(inode->getData()[readStart]);
|
uint8_t *it = &(inode->getData()[readStart]);
|
||||||
for (typename Header::FsSize_t i = 0; i < readSize; i++) {
|
for (typename Header::FsSize_t i = 0; i < readSize; i++) {
|
||||||
*(data++) = *(it++);
|
T val;
|
||||||
|
for (size_t i = 0; i < sizeof(T); i++) {
|
||||||
|
((uint8_t*) (&val))[i] = *(it++);
|
||||||
|
}
|
||||||
|
*(data++) = val;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user