From b631fb3d052b767ccd0281b0d008cdaf810b5267 Mon Sep 17 00:00:00 2001 From: Thiago Mucci Date: Mon, 13 Jul 2026 09:11:42 -0400 Subject: [PATCH] Fix TextSubtext() returning empty string when position is 0 (#5975) --- src/rtext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rtext.c b/src/rtext.c index 35c6f7307..248857975 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1699,7 +1699,7 @@ const char *TextSubtext(const char *text, int position, int length) static char buffer[MAX_TEXT_BUFFER_LENGTH] = { 0 }; memset(buffer, 0, MAX_TEXT_BUFFER_LENGTH); - if ((text != NULL) && (position > 0) && (length > 0)) + if ((text != NULL) && (position >= 0) && (length > 0)) { int textLength = TextLength(text);