Super Game Boy: test for file extension size (#653)

it was hard coded to 4 which caused MSU-1 files to not be found for
.GB extension ROMs
This commit is contained in:
Cray Elliott
2022-07-01 10:18:17 -07:00
committed by GitHub
parent ef52c42b1c
commit adef6c30e2

View File

@@ -363,7 +363,8 @@ void snes_msu_init(const char* name)
FileClose(&f_audio);
memset(snes_romFileName, 0, 1024);
strncpy(snes_romFileName, name, strlen(name) - 4);
int extSize = strlen(strrchr(name, '.'));
strncpy(snes_romFileName, name, strlen(name) - extSize);
printf("MSU: Rom named '%s' initialised\n", name);
snprintf(SelectedPath, sizeof(SelectedPath), "%s.msu", snes_romFileName);