(svn r26489) -Codechange: properly account for the end of buffers in the file io code instead of assuming MAX_PATH is okay

This commit is contained in:
rubidium
2014-04-23 21:23:21 +00:00
parent a0eaaf80b7
commit 5c7c2445d8
10 changed files with 95 additions and 88 deletions

View File

@@ -182,8 +182,8 @@ static void MusicVolumeChanged(byte new_vol)
static void DoPlaySong()
{
char filename[MAX_PATH];
if (FioFindFullPath(filename, lengthof(filename), BASESET_DIR, BaseMusic::GetUsedSet()->files[_music_wnd_cursong - 1].filename) == NULL) {
FioFindFullPath(filename, lengthof(filename), OLD_GM_DIR, BaseMusic::GetUsedSet()->files[_music_wnd_cursong - 1].filename);
if (FioFindFullPath(filename, lastof(filename), BASESET_DIR, BaseMusic::GetUsedSet()->files[_music_wnd_cursong - 1].filename) == NULL) {
FioFindFullPath(filename, lastof(filename), OLD_GM_DIR, BaseMusic::GetUsedSet()->files[_music_wnd_cursong - 1].filename);
}
_music_driver->PlaySong(filename);
SetWindowDirty(WC_MUSIC_WINDOW, 0);