mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix pasting crash in edit box (fixes #4230)
Don't allocate string with -1 size
This commit is contained in:
parent
f0ef018d1e
commit
663eea9cab
|
@ -51,7 +51,7 @@ int CUIEx::DoEditBox(void *pID, const CUIRect *pRect, char *pStr, unsigned StrSi
|
|||
const char *pText = Input()->GetClipboardText();
|
||||
if(pText)
|
||||
{
|
||||
int OffsetL = minimum(str_length(pStr), m_CurCursor);
|
||||
int OffsetL = clamp(m_CurCursor, 0, str_length(pStr));
|
||||
int OffsetR = OffsetL;
|
||||
|
||||
if(m_HasSelection)
|
||||
|
|
Loading…
Reference in a new issue