mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Fixed crash when the string resource is not found in Language.dll.
This commit is contained in:
parent
a7cbc1a504
commit
834bcd7bcd
@ -745,7 +745,7 @@ std::wstring GetFormattedString(UINT id, ...)
|
|||||||
va_list args = NULL;
|
va_list args = NULL;
|
||||||
va_start(args, id);
|
va_start(args, id);
|
||||||
|
|
||||||
FormatMessage(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER,
|
DWORD len = FormatMessage(FORMAT_MESSAGE_FROM_STRING | FORMAT_MESSAGE_ALLOCATE_BUFFER,
|
||||||
GetString(id),
|
GetString(id),
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
@ -755,8 +755,8 @@ std::wstring GetFormattedString(UINT id, ...)
|
|||||||
|
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
std::wstring tmpSz = pBuffer;
|
std::wstring tmpSz(len ? pBuffer : L"");
|
||||||
LocalFree(pBuffer);
|
if (pBuffer) LocalFree(pBuffer);
|
||||||
return tmpSz;
|
return tmpSz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user