diff --git a/deps/ox/src/ox/fs/filestore.hpp b/deps/ox/src/ox/fs/filestore.hpp index f7193609..86e9dce3 100644 --- a/deps/ox/src/ox/fs/filestore.hpp +++ b/deps/ox/src/ox/fs/filestore.hpp @@ -647,9 +647,14 @@ int FileStore
::read(Inode *inode, typename Header::FsSize_t readStart, } 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++) { - *(data++) = *(it++); + T val; + ox_memset(&val, 0, sizeof(T)); + for (size_t i = 0; i < sizeof(T); i++) { + ((uint8_t*) (&val))[i] = *(it++); + } + *(data++) = val; } return 0; }