fixed LoadCodepoints returning a freed ptr when count is 0

This commit is contained in:
Minnowo 2024-06-22 00:27:11 -04:00
parent e7acdd12d8
commit 8794d150e2
No known key found for this signature in database
GPG Key ID: B5E504E1ECA46D32

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;