diff --git a/Library/DialogAbout.cpp b/Library/DialogAbout.cpp index 34055ea5..b7114a78 100644 --- a/Library/DialogAbout.cpp +++ b/Library/DialogAbout.cpp @@ -1150,8 +1150,8 @@ INT_PTR CDialogAbout::CTabVersion::OnCommand(WPARAM wParam, LPARAM lParam) case IDC_ABOUTVERSION_COPY_BUTTON: { WCHAR tmpSz[64]; - _snwprintf_s(tmpSz, _TRUNCATE, L"%s%s r%i %s (%s)", APPVERSION, revision_beta ? L" beta" : L"", revision_number, APPBITS, APPDATE); - std::wstring text = tmpSz; + int len = _snwprintf_s(tmpSz, _TRUNCATE, L"%s%s r%i %s (%s)", APPVERSION, revision_beta ? L" beta" : L"", revision_number, APPBITS, APPDATE); + std::wstring text(tmpSz, len); text += L"\nPath: "; text += Rainmeter->GetPath(); text += L"\nIniFile: "; diff --git a/Library/Litestep.cpp b/Library/Litestep.cpp index 38991873..b3db2532 100644 --- a/Library/Litestep.cpp +++ b/Library/Litestep.cpp @@ -331,7 +331,7 @@ std::wstring GetFormattedString(UINT id, ...) va_end(args); - std::wstring tmpSz(len ? pBuffer : L""); + std::wstring tmpSz(len ? pBuffer : L"", len); if (pBuffer) LocalFree(pBuffer); return tmpSz; }