fix error in textinsert, found by github user chrg127 (#5644)

This commit is contained in:
Thomas Anderson
2026-03-12 05:38:06 -05:00
committed by GitHub
parent 8a93587eaa
commit f9ea607385

View File

@@ -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