summaryrefslogtreecommitdiffhomepage
path: root/editor
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-05-25 07:38:17 +0200
committerStanislaw Halik <sthalik@misaki.pl>2023-05-25 07:38:17 +0200
commit5e3cbab0d0f08bc06141a565a1ef1e7d14bba9b7 (patch)
treed8497961d5f45389611884c9282a09e7b62535a9 /editor
parent0cb4e069f5168102a7050c01540966cfeaa01212 (diff)
editor/inspect: fix off-by one due to null terminator
Diffstat (limited to 'editor')
-rw-r--r--editor/inspect.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/editor/inspect.cpp b/editor/inspect.cpp
index 131f15e1..7f69b56f 100644
--- a/editor/inspect.cpp
+++ b/editor/inspect.cpp
@@ -89,7 +89,7 @@ bool do_inspect_field(void* datum, const erased_accessor& accessor, field_repr r
ret = ImGui::InputText(label, const_cast<char*>(value.data()), value.size(), ImGuiInputTextFlags_ReadOnly);
else if constexpr(std::is_same_v<T, String>)
{
- ret = ImGui::InputText(label, value.begin(), value.size(), ImGuiInputTextFlags_CallbackResize, corrade_string_resize_callback, &value);
+ ret = ImGui::InputText(label, value.begin(), value.size()+1, ImGuiInputTextFlags_CallbackResize, corrade_string_resize_callback, &value);
if (auto max_len = accessor.get_max_length(datum); value.size() > max_len)
value = value.prefix(max_len);
}