From 509311604c7de5e72ca77889ce9a7c23ddde8ae1 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Sun, 14 Sep 2025 23:42:09 +0200 Subject: [PATCH] Fix off-by-one in imgui call --- client/scenes/lobby_gui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/scenes/lobby_gui.cpp b/client/scenes/lobby_gui.cpp index 8cfddc10..1f585f8b 100644 --- a/client/scenes/lobby_gui.cpp +++ b/client/scenes/lobby_gui.cpp @@ -134,14 +134,14 @@ static void InputText(const char * label, std::string & text, const ImVec2 & siz if (data->EventFlag == ImGuiInputTextFlags_CallbackResize) { assert(text.data() == data->Buf); - text.resize(data->BufTextLen); + text.resize(data->BufTextLen + 1); data->Buf = text.data(); } return 0; }; - ImGui::InputTextEx(label, nullptr, text.data(), text.size(), size, flags | ImGuiInputTextFlags_CallbackResize, callback, &text); + ImGui::InputTextEx(label, nullptr, text.data(), text.size() + 1, size, flags | ImGuiInputTextFlags_CallbackResize, callback, &text); } static void display_recentering_tip(imgui_context & ctx, const std::string & tip)