make working dir save to a platform specific file

fix a possible buffer overflow in MemcardManager when creating a gci savename
fix Previous Page button from being available after deleting the last save on page 2
remove magic numbers from GCMemcard

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3819 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
LPFaint99
2009-07-17 06:03:53 +00:00
parent 598d640042
commit 15d49e5afd
4 changed files with 113 additions and 87 deletions

View File

@ -132,7 +132,12 @@ bool DolphinApp::OnInit()
if (!noCheckForInstallDir)
{
char tmp[1024];
sprintf(tmp, "%s/.dolphinwd", (const char*)wxStandardPaths::Get().GetUserConfigDir().mb_str(wxConvUTF8));
sprintf(tmp, "%s/.dolphin%swd", (const char*)wxStandardPaths::Get().GetUserConfigDir().mb_str(wxConvUTF8),
#ifdef _M_IX86
"x32");
#else
"x64");
#endif
FILE* workingDir = fopen(tmp, "r");
if (!workingDir)
{
@ -174,7 +179,7 @@ bool DolphinApp::OnInit()
fclose(workingDir);
if (!wxSetWorkingDirectory(wxString::FromAscii(tmpChar)))
{
PanicAlert("set working directory failed");
INFO_LOG(CONSOLE, "set working directory failed");
}
delete [] tmpChar;
}