From a757184e5db3112d3de0b69eec7d39b937e396bc Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 25 Jul 2013 15:32:06 +0000 Subject: replace sprintf to mir_snprintf (part 5) git-svn-id: http://svn.miranda-ng.org/main/trunk@5481 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Variables/src/parse_system.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/Variables/src/parse_system.cpp') diff --git a/plugins/Variables/src/parse_system.cpp b/plugins/Variables/src/parse_system.cpp index 67ebf3dd0e..026007a10f 100644 --- a/plugins/Variables/src/parse_system.cpp +++ b/plugins/Variables/src/parse_system.cpp @@ -54,11 +54,12 @@ static TCHAR *parseCpuLoad(ARGUMENTSINFO *ai) { if ( _tcslen(ai->targv[1]) == 0) szCounter = mir_tstrdup(_T("\\Processor(_Total)\\% Processor Time")); else { - szCounter = (TCHAR*)mir_alloc((_tcslen(ai->targv[1]) + 32)*sizeof(TCHAR)); + int size = _tcslen(ai->targv[1]) + 32; + szCounter = (TCHAR *)mir_alloc(size * sizeof(TCHAR)); if (szCounter == NULL) return NULL; - wsprintf(szCounter, _T("\\Process(%s)\\%% Processor Time"), ai->targv[1]); + mir_sntprintf(szCounter, size, _T("\\Process(%s)\\%% Processor Time"), ai->targv[1]); } PDH_STATUS pdhStatus = PdhValidatePath(szCounter); if (pdhStatus != ERROR_SUCCESS) { -- cgit v1.2.3