From 99dfec070a32d22dc1e1973a2a5e110e4304f435 Mon Sep 17 00:00:00 2001 From: sleeptightAnsiC <91839286+sleeptightAnsiC@users.noreply.github.com> Date: Fri, 31 Jan 2025 14:44:23 +0100 Subject: [PATCH] [rtext] fix: misuse of cast in GetCodepointCount (#4741) I was really wondering what is going on here :D I believe this code tried initially to out-cast 'const' specifier but this is not needed here at all. Currently, it just confuses whoever reads this so I changed it. The old code would also trigger -Wcast-qual warning on some compilers. --- src/rtext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rtext.c b/src/rtext.c index d8d290053..982402f54 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1915,7 +1915,7 @@ void UnloadCodepoints(int *codepoints) int GetCodepointCount(const char *text) { unsigned int length = 0; - char *ptr = (char *)&text[0]; + const char *ptr = text; while (*ptr != '\0') {