diff options
| author | Ray <raysan5@gmail.com> | 2019-10-21 17:37:43 +0200 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2019-10-21 17:37:43 +0200 |
| commit | c1d282d9e8820db4c3fa24c9847bddb47c859765 (patch) | |
| tree | 2650e6a288b9bb5b09e07ac33f82b94a82dd1ccd | |
| parent | e25f4dca1f64c7e224013de1d104f90f909e04fd (diff) | |
| download | raylib-c1d282d9e8820db4c3fa24c9847bddb47c859765.tar.gz raylib-c1d282d9e8820db4c3fa24c9847bddb47c859765.zip | |
Corrected bug on no-extension
| -rw-r--r-- | src/core.c | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -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; + } } } |
