diff --git a/Client/gui/CGUI_Impl.cpp b/Client/gui/CGUI_Impl.cpp index 1bea5b6810..6b2ad38656 100644 --- a/Client/gui/CGUI_Impl.cpp +++ b/Client/gui/CGUI_Impl.cpp @@ -907,7 +907,7 @@ bool CGUI_Impl::Event_KeyDown ( const CEGUI::EventArgs& Args ) // Put the editbox's data into a string and insert the data if it has not reached it's maximum text length std::wstring tmp = MbUTF8ToUTF16(strEditText.c_str()); - if ( ( strClipboardText.length () + tmp.length () ) <= iMaxLength ) + if ( ( strClipboardText.length () + tmp.length () - iSelectionLength ) <= iMaxLength ) { // Are there characters selected? size_t sizeCaratIndex = 0;