diff --git a/libretro.cpp b/libretro.cpp index 02fce1ce..8386a54c 100644 --- a/libretro.cpp +++ b/libretro.cpp @@ -4254,13 +4254,13 @@ static bool MDFNI_LoadGame(const char *name) RFILE *GameFile = NULL; size_t name_len = strlen(name); - if(name_len > 4 && ( - !strcasecmp(name + name_len - 4, ".cue") || - !strcasecmp(name + name_len - 4, ".ccd") || - !strcasecmp(name + name_len - 4, ".toc") || - !strcasecmp(name + name_len - 4, ".m3u") || - !strcasecmp(name + name_len - 4, ".chd") || - !strcasecmp(name + name_len - 4, ".pbp") + if(name_len > 3 && ( + !strcasecmp(name + name_len - 3, "cue") || + !strcasecmp(name + name_len - 3, "ccd") || + !strcasecmp(name + name_len - 3, "toc") || + !strcasecmp(name + name_len - 3, "m3u") || + !strcasecmp(name + name_len - 3, "chd") || + !strcasecmp(name + name_len - 3, "pbp") )) return MDFNI_LoadCD(name); diff --git a/mednafen/cdrom/CDAccess.cpp b/mednafen/cdrom/CDAccess.cpp index 7c2cc02b..04b1e729 100644 --- a/mednafen/cdrom/CDAccess.cpp +++ b/mednafen/cdrom/CDAccess.cpp @@ -48,14 +48,14 @@ CDAccess::~CDAccess() CDAccess *cdaccess_open_image(bool *success, const char *path, bool image_memcache) { size_t path_len = strlen(path); - if (path_len >= 4 && !strcasecmp(path + path_len - 4, ".ccd")) + if (path_len >= 3 && !strcasecmp(path + path_len - 3, "ccd")) return new CDAccess_CCD(success, path, image_memcache); #ifdef HAVE_PBP - else if (path_len >= 4 && !strcasecmp(path + path_len - 4, ".pbp")) + else if (path_len >= 3 && !strcasecmp(path + path_len - 3, "pbp")) return new CDAccess_PBP(path, image_memcache); #endif #ifdef HAVE_CHD - else if (path_len >= 4 && !strcasecmp(path + path_len - 4, ".chd")) + else if (path_len >= 3 && !strcasecmp(path + path_len - 3, "chd")) return new CDAccess_CHD(path, image_memcache); #endif return new CDAccess_Image(success, path, image_memcache);