mirror of
https://github.com/raysan5/raylib.git
synced 2026-03-19 07:08:10 +00:00
fix error in textinsert, found by github user chrg127 (#5644)
This commit is contained in:
@@ -1875,7 +1875,7 @@ char *TextInsert(const char *text, const char *insert, int position)
|
||||
result = (char *)RL_MALLOC(textLen + insertLen + 1);
|
||||
|
||||
for (int i = 0; i < position; i++) result[i] = text[i];
|
||||
for (int i = position; i < insertLen + position; i++) result[i] = insert[i];
|
||||
for (int i = position; i < insertLen + position; i++) result[i] = insert[i - position];
|
||||
for (int i = (insertLen + position); i < (textLen + insertLen); i++) result[i] = text[i];
|
||||
|
||||
result[textLen + insertLen] = '\0'; // Add EOL
|
||||
|
||||
Reference in New Issue
Block a user