diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-11 01:15:28 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-01-11 01:15:28 +0100 |
commit | 9e3c0ac3f71cf2148e4788793efea5968f1a46b2 (patch) | |
tree | 68a3a78e39feef9b90bb1c7e6366a6ff4ce84dd0 /loader/atlas.cpp | |
parent | 760223387603952bd82171ce188649c817452363 (diff) |
loader: add missing null terminated flag
Diffstat (limited to 'loader/atlas.cpp')
-rw-r--r-- | loader/atlas.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/loader/atlas.cpp b/loader/atlas.cpp index 68a94f0b..7d8539da 100644 --- a/loader/atlas.cpp +++ b/loader/atlas.cpp @@ -22,8 +22,9 @@ StringView loader_::make_atlas_path(char(&buf)[FILENAME_MAX], StringView dir, St fm_soft_assert(dirsiz + namesiz + 1 < FILENAME_MAX); std::memcpy(buf, dir.data(), dirsiz); std::memcpy(&buf[dirsiz], name.data(), namesiz); - buf[dirsiz + namesiz] = '\0'; - return StringView{buf}; + auto len = dirsiz + namesiz; + buf[len] = '\0'; + return StringView{buf, len, StringViewFlag::NullTerminated}; } bool loader_::check_atlas_name(StringView str) noexcept |