From 14fb733a8fde2c0b66f956eebd71d4e64b292fd2 Mon Sep 17 00:00:00 2001 From: spx Date: Sat, 8 Sep 2012 10:09:14 -0700 Subject: [PATCH] Tweaks --- Library/DialogAbout.cpp | 4 ++-- Library/Litestep.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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; }