[ox/fs] Fix FileAddress paths initialized from StringView to null terminate
This commit is contained in:
parent
1839b68a4a
commit
858a30ee08
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user