From c1d282d9e8820db4c3fa24c9847bddb47c859765 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 21 Oct 2019 17:37:43 +0200 Subject: [PATCH] Corrected bug on no-extension --- src/core.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/core.c b/src/core.c index 9fe29b8ff..b4f955adc 100644 --- a/src/core.c +++ b/src/core.c @@ -1798,15 +1798,18 @@ bool IsFileExtension(const char *fileName, const char *ext) bool result = false; const char *fileExt = GetExtension(fileName); - int extCount = 0; - const char **checkExts = TextSplit(ext, ';', &extCount); - - for (int i = 0; i < extCount; i++) + if (fileExt != NULL) { - if (strcmp(fileExt, checkExts[i] + 1) == 0) + int extCount = 0; + const char **checkExts = TextSplit(ext, ';', &extCount); + + for (int i = 0; i < extCount; i++) { - result = true; - break; + if (strcmp(fileExt, checkExts[i] + 1) == 0) + { + result = true; + break; + } } }