Fix FS read by type to read byte by byte

This commit is contained in:
Gary Talent 2017-05-09 11:48:58 -05:00
parent bb5939a663
commit c971969a73

View File

@ -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;
} }