Fix Exception in main.cpp

If Project64 is run from C:\Project64, we get an exception in main.cpp.

This fixes that bug.
This commit is contained in:
Frank-74 2016-08-21 17:20:42 +01:00 committed by GitHub
parent 0fe208fbe3
commit 8e75fed8d9
1 changed files with 5 additions and 0 deletions

View File

@ -587,6 +587,11 @@ void CPath::SetComponents(const char * lpszDrive, const char * lpszDirectory, co
char buff_fullname[MAX_PATH]; char buff_fullname[MAX_PATH];
memset(buff_fullname, 0, sizeof(buff_fullname)); memset(buff_fullname, 0, sizeof(buff_fullname));
if (lpszDirectory == NULL || strlen(lpszDirectory) == 0)
{
static char empty_dir[] = { DIRECTORY_DELIMITER, '\0' };
lpszDirectory = empty_dir;
}
_makepath(buff_fullname, lpszDrive, lpszDirectory, lpszName, lpszExtension); _makepath(buff_fullname, lpszDrive, lpszDirectory, lpszName, lpszExtension);
m_strPath.erase(); m_strPath.erase();