From 1e15616b694750def089c74b7a29ad95da4544a0 Mon Sep 17 00:00:00 2001 From: Jak Barnes Date: Sun, 10 Feb 2019 16:01:44 +0000 Subject: [PATCH] Fixed as issue where strrchr in LoadBMFont would only look for forward slashes, instead of backslashes causing strlen to fail on a null string --- src/text.c | 4 ++++ 1 file changed, 4 insertions(+) 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);