Fixed crash when the string resource is not found in Language.dll.

This commit is contained in:
spx 2011-09-24 13:41:07 +00:00
parent a7cbc1a504
commit 834bcd7bcd

View File

@ -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;
} }