diff --git a/src/input_context.cpp b/src/input_context.cpp index 17367869fb7d7..b94636efeffff 100644 --- a/src/input_context.cpp +++ b/src/input_context.cpp @@ -609,8 +609,8 @@ void keybindings_ui::draw_controls() if( last_status != status && status == s_show ) { ImGui::SetKeyboardFocusHere( 0 ); } - strncpy( filter_text_impl, filter_text.c_str(), strlen( filter_text.c_str() ) ); - ImGui::InputText( "##NOLABEL", filter_text_impl, 255, + strncpy( filter_text_impl, filter_text.c_str(), filter_text.length() ); + ImGui::InputText( "##NOLABEL", filter_text_impl, std::extent< decltype( filter_text_impl )>::value, status == s_show ? ImGuiInputTextFlags_None : ImGuiInputTextFlags_ReadOnly ); filter_text.assign( filter_text_impl ); ImGui::Separator();