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:
spx
2010-12-16 20:35:44 +00:00
parent 806a86fe65
commit d1a7b604df
20 changed files with 361 additions and 359 deletions

View File

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