diff --git a/desmume/src/frontend/windows/mic-win.cpp b/desmume/src/frontend/windows/mic-win.cpp index faf4757e0..c74db3393 100644 --- a/desmume/src/frontend/windows/mic-win.cpp +++ b/desmume/src/frontend/windows/mic-win.cpp @@ -243,22 +243,26 @@ bool LoadSamples(const char *name) //if we're disabling the mic samples system, just bail now if (!name || !*name) return true; - //analyze the filename for 0 at the end. anything with 0 at the end is assumed to be the beginning of a series of files + //analyze the filename for _0 at the end. anything with _0 at the end is assumed to be the beginning of a series of files //(and if not, it can still be loaded just fine) - const char* ext = strchr(name,'.'); + const char* ext = strrchr(name,'.'); //in case the filename had no extension... it's an error. if(!ext) return false; - const char* maybe0 = ext-1; + const char* maybe_0 = ext-2; + + //in case this was an absurdly short filename + if(ext