mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Core dll:
- Replace swprintf/wsprintf/wcscpy/wcscat to _snwprintf_s/wcsncpy_s/wcsncat_s. - Changed printf format parameter strictly for supporting both 32bit and 64bit. - Fixed an issue that !RainmeterWriteKeyValue doesn't accept %APPDATA%\Rainmeter path. - Code cleanup.
This commit is contained in:
@ -584,7 +584,7 @@ void CMeter::ReadMeasureNames(CConfigParser& parser, const WCHAR* section, std::
|
||||
bool loop = true;
|
||||
do
|
||||
{
|
||||
swprintf(tmpName, L"MeasureName%i", i);
|
||||
_snwprintf_s(tmpName, _TRUNCATE, L"MeasureName%i", i);
|
||||
std::wstring measure = parser.ReadString(section, tmpName, L"");
|
||||
if (!measure.empty())
|
||||
{
|
||||
@ -614,7 +614,7 @@ bool CMeter::ReplaceMeasures(const std::vector<std::wstring>& stringValues, std:
|
||||
// Create the actual text (i.e. replace %1, %2, .. with the measure texts)
|
||||
for (size_t i = stringValues.size(); i > 0; --i)
|
||||
{
|
||||
wsprintf(buffer, L"%%%i", i);
|
||||
_snwprintf_s(buffer, _TRUNCATE, L"%%%i", (int)i);
|
||||
|
||||
size_t start = 0;
|
||||
size_t pos = std::wstring::npos;
|
||||
|
Reference in New Issue
Block a user