Browse Source

Merge pull request #749 from Syphonx/master

LoadBMFont filepath fix
pull/755/head
Ray 5 years ago
committed by GitHub
parent
commit
dde99f45d9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/text.c

+ 4
- 0
src/text.c View File

@ -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);

Loading…
Cancel
Save