Fixed: Rainmeter drops commands in !Execute series that are too long. (http://code.google.com/p/rainmeter/issues/detail?id=103)

This commit is contained in:
Kimmo Pekkola 2009-09-02 18:05:07 +00:00
parent 9fcd6896de
commit 9b949a12e0
2 changed files with 5 additions and 5 deletions

View File

@ -458,7 +458,7 @@ void CConfigParser::ReadIniFile(const std::wstring& iniFile)
items[0] = 0;
int res = GetPrivateProfileString( NULL, NULL, NULL, items, size, iniFile.c_str());
if (res == 0) return; // File not found
if (res != size - 2) break; // Fits in the buffer
if (res < size - 2) break; // Fits in the buffer
delete [] items;
size *= 2;
@ -487,7 +487,7 @@ void CConfigParser::ReadIniFile(const std::wstring& iniFile)
{
items[0] = 0;
int res = GetPrivateProfileString((*iter).first.c_str(), NULL, NULL, items, size, iniFile.c_str());
if (res != size - 2) break; // Fits in the buffer
if (res < size - 2) break; // Fits in the buffer
delete [] items;
size *= 2;
@ -503,11 +503,11 @@ void CConfigParser::ReadIniFile(const std::wstring& iniFile)
{
buffer[0] = 0;
int res = GetPrivateProfileString((*iter).first.c_str(), strKey.c_str(), L"", buffer, bufferSize, iniFile.c_str());
if (res != size - 2) break; // Fits in the buffer
if (res < bufferSize - 2) break; // Fits in the buffer
delete [] buffer;
bufferSize *= 2;
buffer = new WCHAR[size];
buffer = new WCHAR[bufferSize];
};
SetValue((*iter).first, strKey, buffer);

View File

@ -1417,7 +1417,7 @@ void CMeterWindow::ReadSkin()
{
int res = GetPrivateProfileString( NULL, NULL, NULL, items, size, iniFile.c_str());
if (res == 0) return; // File not found
if (res != size - 2) break; // Fits in the buffer
if (res < size - 2) break; // Fits in the buffer
delete [] items;
size *= 2;