diff --git a/changelog.txt b/changelog.txt index f2863900..86ea2edd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,4 @@ +30-Aug-2012 - AnS - fixed savestates filenaming bug when working with a movie 29-Aug-2012 - AnS - added "Force Grayscale" checkbox to Palette config 26-Aug-2012 - AnS - Taseditor: History Log highlights items related to current item 25-Aug-2012 - AnS - Taseditor: fixed AdjustLag feature and changed fm3 version to v2 diff --git a/src/drivers/win/help/fceux.chm b/src/drivers/win/help/fceux.chm index fa86f7d0..1a9b81d1 100644 Binary files a/src/drivers/win/help/fceux.chm and b/src/drivers/win/help/fceux.chm differ diff --git a/src/file.cpp b/src/file.cpp index 11448570..78427e3c 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -566,7 +566,7 @@ std::string FCEU_MakeFName(int type, int id1, const char *cd1) char ret[FILENAME_MAX] = ""; struct stat tmpstat; std::string mfnString; - const char* mfn; + const char* mfn; // the movie filename switch(type) { @@ -582,19 +582,21 @@ std::string FCEU_MakeFName(int type, int id1, const char *cd1) break; case FCEUMKF_STATE: { - if (bindSavestate) mfnString = GetMfn(); - else mfnString = ""; - - if (mfnString.length() < 60) //This caps the movie filename length before adding it to the savestate filename. - mfn = mfnString.c_str(); //This helps prevent possible crashes from savestate filenames of excessive length. - - else - { - std::string mfnStringTemp = mfnString.substr(0,60); - mfn = mfnStringTemp.c_str(); //mfn is the movie filename - } - + if (bindSavestate) + mfnString = GetMfn(); + else + mfnString = ""; + if (mfnString.length() <= MAX_MOVIEFILENAME_LEN) + { + mfn = mfnString.c_str(); + } else + { + //This caps the movie filename length before adding it to the savestate filename. + //This helps prevent possible crashes from savestate filenames of excessive length. + mfnString = mfnString.substr(0, MAX_MOVIEFILENAME_LEN); + mfn = mfnString.c_str(); + } if(odirs[FCEUIOD_STATES]) { diff --git a/src/file.h b/src/file.h index 92746d82..9df010cc 100644 --- a/src/file.h +++ b/src/file.h @@ -1,6 +1,8 @@ #ifndef _FCEU_FILE_H_ #define _FCEU_FILE_H_ +#define MAX_MOVIEFILENAME_LEN 80 + #include #include #include "types.h" diff --git a/vc/Help/fceux.hnd b/vc/Help/fceux.hnd index 5a76a4ba..999e1df7 100644 Binary files a/vc/Help/fceux.hnd and b/vc/Help/fceux.hnd differ