From f9ea60738547fed4e9a2e16af6c5b83b08475281 Mon Sep 17 00:00:00 2001 From: Thomas Anderson <5776225+CrackedPixel@users.noreply.github.com> Date: Thu, 12 Mar 2026 05:38:06 -0500 Subject: [PATCH] fix error in textinsert, found by github user chrg127 (#5644) --- src/rtext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rtext.c b/src/rtext.c index 1cffd3bb4..aa01e9015 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -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