diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-19 11:01:14 +0100 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-19 11:02:04 +0100 |
| commit | 1eef324dc9ffcd0bc115b283a038cc175f64deb5 (patch) | |
| tree | 104b76f9e8d246b246322b97ce6a9c25b05cb260 /editor/inspect.cpp | |
| parent | aadd93718a851ac36a6eefbfec273c81ebf7cc14 (diff) | |
editor, main: assert StringView null termination
Diffstat (limited to 'editor/inspect.cpp')
| -rw-r--r-- | editor/inspect.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/inspect.cpp b/editor/inspect.cpp index 0609c4be..df286391 100644 --- a/editor/inspect.cpp +++ b/editor/inspect.cpp @@ -108,12 +108,12 @@ bool do_inspect_field(void* datum, const erased_accessor& accessor, field_repr r case field_repr::cbx: { if constexpr(std::is_integral_v<T>) { - const char* preview = "<invalid>"; + StringView preview = "<invalid>"_s; const auto old_value = (size_t)static_cast<std::make_unsigned_t<T>>(value); for (const auto& [str, x] : list) if (x == old_value) { - preview = str.data(); + preview = str; break; } if (auto b = begin_combo(label, preview)) |
