Fixed the crash issue that the commandline option length is less than 4 characters.

This commit is contained in:
spx 2010-08-04 08:10:54 +00:00
parent 229fc944e8
commit ff04d39bad

View File

@ -1247,7 +1247,7 @@ int CRainmeter::Initialize(HWND Parent, HINSTANCE Instance, LPCSTR szPath)
{ {
iniFile += L"Rainmeter.ini"; iniFile += L"Rainmeter.ini";
} }
else if (iniFile.substr(iniFile.length() - 4) != L".ini") else if (iniFile.length() <= 4 || iniFile.substr(iniFile.length() - 4) != L".ini")
{ {
iniFile += L"\\Rainmeter.ini"; iniFile += L"\\Rainmeter.ini";
} }