Don't null-terminate
This commit is contained in:
@@ -128,9 +128,8 @@ static std::string_view arena_copy_string(std::string_view str,
|
||||
if (str.empty()) {
|
||||
return std::string_view{};
|
||||
}
|
||||
char *copied = arena.allocate<char>(str.size() + 1);
|
||||
char *copied = arena.allocate<char>(str.size());
|
||||
std::memcpy(copied, str.data(), str.size());
|
||||
copied[str.size()] = '\0';
|
||||
return std::string_view(copied, str.size());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user