summaryrefslogtreecommitdiff
path: root/plugins/KeyboardNotify/src/main.cpp
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2014-12-02 03:47:27 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2014-12-02 03:47:27 +0000
commit6e2b6b31bae6d69bff5271451e73eb08637b8118 (patch)
treeca636f1497e4cc6980736d56a7ff61e3a6f88079 /plugins/KeyboardNotify/src/main.cpp
parentd83beb598f0944dcb944524b1d27525dc320cf18 (diff)
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
Diffstat (limited to 'plugins/KeyboardNotify/src/main.cpp')
-rw-r--r--plugins/KeyboardNotify/src/main.cpp12
1 files changed, 6 insertions, 6 deletions
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);
}
}