[ox/fs] Fix FileAddress paths initialized from StringView to null terminate

(synced from 858a30ee08)
This commit is contained in:
2022-11-30 20:48:09 -06:00
parent 8f66a13868
commit 79f61757e6
+2 -1
View File
@@ -30,8 +30,9 @@ FileAddress::FileAddress(uint64_t inode) noexcept {
FileAddress::FileAddress(ox::CRStringView path) noexcept {
auto pathSize = path.bytes();
m_data.path = new char[pathSize];
m_data.path = new char[pathSize + 1];
memcpy(m_data.path, path.data(), pathSize);
m_data.path[pathSize] = 0;
m_type = FileAddressType::Path;
}