Pārlūkot izejas kodu

Fixed as issue where strrchr in LoadBMFont would only look for forward slashes, instead of backslashes causing strlen to fail on a null string

pull/749/head
Jak Barnes pirms 5 gadiem
vecāks
revīzija
1e15616b69
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. +4
    -0
      src/text.c

+ 4
- 0
src/text.c Parādīt failu

@ -1406,6 +1406,10 @@ static Font LoadBMFont(const char *fileName)
char *lastSlash = NULL;
lastSlash = strrchr(fileName, '/');
if (lastSlash == NULL)
{
lastSlash = strrchr(fileName, '\\');
}
// NOTE: We need some extra space to avoid memory corruption on next allocations!
texPath = malloc(strlen(fileName) - strlen(lastSlash) + strlen(texFileName) + 4);

Notiek ielāde…
Atcelt
Saglabāt