Skip to content

Commit

Permalink
fixes #139 (assertion on corrupt recent file path)
Browse files Browse the repository at this point in the history
  • Loading branch information
bazz1tv committed Sep 29, 2020
1 parent fed6596 commit cc99188
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pc/shared/App_Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void App_Settings::save()
std::stringstream row;

//sprintf( row, "### Preferences file V.%s for MeatBall V.0 #### \n\n", PREF_VERSION );
row << "### Preferences file V." << PREF_VERSION << " for " << APP_NAME << " V.0 #### \n\n";
row << "### Preferences file V." << PREF_VERSION << " for " << APP_NAME_VERSION << " #### \n\n";
ofs.write( row.str().c_str(), row.str().length() );
Utility::clearsstream(row);

Expand Down
2 changes: 1 addition & 1 deletion pc/shared/App_Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "File_System.h"

/// Current Settings Revision
#define PREF_VERSION "0.6"
#define PREF_VERSION "0.6.1"

/// User Settings File
#define USER_PREF_FILE_NAME "Preferences.ini"
Expand Down
4 changes: 2 additions & 2 deletions pc/shared/Organization.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#define COMPANY_NAME "Black Hole Studios"
#define APP_NAME "SNES Tracker"
#define APP_VER_MAJOR 0
#define APP_VER_MINOR 1
#define APP_VER_MICRO 1
#define APP_VER_MINOR 2
#define APP_VER_MICRO 0
// concats the 3 version values into a string
#define APP_VER_STRING(maj, min, mic) #maj "." #min "." #mic
// allows calling the above macro with macro arguments
Expand Down
9 changes: 8 additions & 1 deletion pc/shared/RecentFiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,14 @@ void RecentFiles::createDisplayNames()
if (paths[i] != NULL)
{
char *filename = (char *) Utility::getFileName(paths[i]);
assert(filename != NULL);

// Fixes #139
if (filename == NULL)
{
paths[i] = NULL;
continue;
}

dnames[i] = (char *) SDL_malloc( sizeof(char) * ( strlen(filename) + 1 + 1) );
strcpy(dnames[i], FONT_BULLETPOINT_STR);
strcat(dnames[i], filename);
Expand Down

0 comments on commit cc99188

Please sign in to comment.