Open electrolys opened 3 months ago
gui textbox doesn't handle adding and removing characters properly and causes an underflow (at adding) and overflow (at removal)
at lines https://github.com/raysan5/raygui/blob/6f532337ff2d6dc14ba3a5f5b7ee63f9d90ff13b/src/raygui.h#L2582 https://github.com/raysan5/raygui/blob/6f532337ff2d6dc14ba3a5f5b7ee63f9d90ff13b/src/raygui.h#L2562C21-L2562C113
you are just comparing the variable i with the text length or cursor when you really need to >= cursor+codepointsize and <= length-codepointsize
@electrolys Good catch! Please, could you send a PR with the fix! Thanks!
gui textbox doesn't handle adding and removing characters properly and causes an underflow (at adding) and overflow (at removal)
at lines https://github.com/raysan5/raygui/blob/6f532337ff2d6dc14ba3a5f5b7ee63f9d90ff13b/src/raygui.h#L2582 https://github.com/raysan5/raygui/blob/6f532337ff2d6dc14ba3a5f5b7ee63f9d90ff13b/src/raygui.h#L2562C21-L2562C113
you are just comparing the variable i with the text length or cursor when you really need to >= cursor+codepointsize and <= length-codepointsize