diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 64b7cc722..d94010d9a 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -163,7 +163,10 @@ static void MidiSoundfontPath_Onchange(void) boolean proceed = true; // check if file exists; menu calls this method at every keystroke - while ((miditoken = strtok_r(source, ";", &source))) + // get first token + miditoken = strtok(source, ";"); + + while (miditoken != NULL) { SDL_RWops *rw = SDL_RWFromFile(miditoken, "r"); if (rw != NULL) @@ -173,6 +176,7 @@ static void MidiSoundfontPath_Onchange(void) proceed = false; break; } + miditoken = strtok(NULL, ";"); } free(source);