summaryrefslogtreecommitdiffhomepage
path: root/src/text.c
diff options
context:
space:
mode:
authorJak Barnes <[email protected]>2019-02-10 16:01:44 +0000
committerJak Barnes <[email protected]>2019-02-10 16:01:44 +0000
commit1e15616b694750def089c74b7a29ad95da4544a0 (patch)
tree9c600f0268da3e39c6efc1d63847f365bcfdbe54 /src/text.c
parent366313bfd03c413c60386d51425c34cf9a78afba (diff)
downloadraylib-1e15616b694750def089c74b7a29ad95da4544a0.tar.gz
raylib-1e15616b694750def089c74b7a29ad95da4544a0.zip
Fixed as issue where strrchr in LoadBMFont would only look for forward slashes, instead of backslashes causing strlen to fail on a null string
Diffstat (limited to 'src/text.c')
-rw-r--r--src/text.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/text.c b/src/text.c
index b1f786b7..464c0f02 100644
--- a/src/text.c
+++ b/src/text.c
@@ -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);