Fixed crash when editing textbox at non-end pos

This commit is contained in:
Ben Beshara
2019-06-04 21:16:29 +10:00
parent f4d243ea88
commit 308f916d9d
2 changed files with 4 additions and 2 deletions

View File

@ -2334,7 +2334,7 @@ RAYGUIDEF bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editM
int startIdx = GuiTextBoxGetByteIndex(text, 0, 0, guiTextBoxState.cursor);
int endIdx = startIdx + sz;
if (endIdx <= textSize)
if (endIdx <= textSize && length < textSize - 1)
{
guiTextBoxState.cursor++;
guiTextBoxState.select = -1;