Skip to content

Commit 99dfec0

Browse files
[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.
1 parent 1f6de0c commit 99dfec0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rtext.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1915,7 +1915,7 @@ void UnloadCodepoints(int *codepoints)
19151915
int GetCodepointCount(const char *text)
19161916
{
19171917
unsigned int length = 0;
1918-
char *ptr = (char *)&text[0];
1918+
const char *ptr = text;
19191919

19201920
while (*ptr != '\0')
19211921
{

0 commit comments

Comments
 (0)