Fix TextSubtext() returning empty string when position is 0 (#5975)

This commit is contained in:
Thiago Mucci 2026-07-13 09:11:42 -04:00 • committed by GitHub
commit b631fb3d05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1699,7 +1699,7 @@ const char *TextSubtext(const char *text, int position, int length)
static char buffer[MAX_TEXT_BUFFER_LENGTH] = { 0 }; static char buffer[MAX_TEXT_BUFFER_LENGTH] = { 0 };
memset(buffer, 0, MAX_TEXT_BUFFER_LENGTH); 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); int textLength = TextLength(text);