From 6e2b6b31bae6d69bff5271451e73eb08637b8118 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Tue, 2 Dec 2014 03:47:27 +0000 Subject: mir_sntprintf(..., _T("%s"), ...) -> _tcsncpy_s(..., ..., _TRUNCATE) fix some x64 ptr truncations git-svn-id: http://svn.miranda-ng.org/main/trunk@11211 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/KeyboardNotify/src/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/KeyboardNotify/src') diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp index 1d959950df..cbcdc60627 100644 --- a/plugins/KeyboardNotify/src/main.cpp +++ b/plugins/KeyboardNotify/src/main.cpp @@ -495,12 +495,12 @@ static INT_PTR IsFlashingActiveService(WPARAM, LPARAM) INT_PTR NormalizeSequenceService(WPARAM wParam, LPARAM lParam) { - TCHAR strAux[MAX_PATH+1], *strIn = (TCHAR *)lParam; + TCHAR strAux[MAX_PATH + 1], *strIn = (TCHAR*)lParam; - mir_sntprintf(strAux, MAX_PATH, _T("%s"), strIn); - mir_sntprintf(strIn, MAX_PATH, _T("%s"), normalizeCustomString(strAux)); + _tcsncpy_s(strAux, strIn, _TRUNCATE); + _tcsncpy_s(strIn, MAX_PATH, normalizeCustomString(strAux), _TRUNCATE); - return (int)strIn; + return (INT_PTR)strIn; } @@ -698,10 +698,10 @@ void createEventPrefix(TCHAR *prefixName, size_t maxLen) while (str = _tcschr(profileName, _T('\\'))) *str = _T('/'); if ((len = _tcslen(profileName)) <= maxLen) - _tcscpy(prefixName, profileName); + _tcsncpy_s(prefixName, maxLen, profileName, _TRUNCATE); else { str = profileName + len - maxLen / 2; - mir_sntprintf(prefixName, maxLen / 2, _T("%s"), profileName); + _tcsncpy_s(prefixName, (maxLen / 2), profileName, _TRUNCATE); _tcscat(prefixName, str); } } -- cgit v1.2.3