fixed LoadCodepoints returning a freed ptr when count is 0 (#4089)

This commit is contained in:
Alice Nyaa 2024-06-22 13:17:31 -04:00 committed by GitHub
parent 28f88fd984
commit b0d49579c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1892,8 +1892,7 @@ int *LoadCodepoints(const char *text, int *count)
} }
// Re-allocate buffer to the actual number of codepoints loaded // Re-allocate buffer to the actual number of codepoints loaded
int *temp = (int *)RL_REALLOC(codepoints, codepointCount*sizeof(int)); codepoints = (int *)RL_REALLOC(codepoints, codepointCount*sizeof(int));
if (temp != NULL) codepoints = temp;
*count = codepointCount; *count = codepointCount;