diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-02-23 19:12:50 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-02-23 19:12:50 +0000 |
commit | 16d3d5ca7f9399e7c00f0ae5a24deccf758d0c13 (patch) | |
tree | 22da18f3ca32e7c94ce35c4747ab1479febe2bc8 /plugins/ContextHelp | |
parent | 7080a582908ffcd9f64041c28ca9b9739d735385 (diff) |
ContextHElp: memory corruption fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@16332 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ContextHelp')
-rw-r--r-- | plugins/ContextHelp/src/dlgboxsubclass.cpp | 4 | ||||
-rw-r--r-- | plugins/ContextHelp/src/helppack.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/plugins/ContextHelp/src/dlgboxsubclass.cpp b/plugins/ContextHelp/src/dlgboxsubclass.cpp index 27a01630e1..796983af35 100644 --- a/plugins/ContextHelp/src/dlgboxsubclass.cpp +++ b/plugins/ContextHelp/src/dlgboxsubclass.cpp @@ -345,7 +345,7 @@ static LRESULT CALLBACK DialogBoxSubclassProc(HWND hwndDlg, UINT msg, WPARAM wPa EnumChildWindows(hwndDlg, RemovePropForAllChildsEnumProc, (LPARAM)PROP_CONTEXTSTATE);
{
TCHAR text[64];
- mir_sntprintf(text, sizeof(text), _T("unhooked window 0x%X for context help\n"), hwndDlg);
+ mir_sntprintf(text, _countof(text), _T("unhooked window 0x%X for context help\n"), hwndDlg);
OutputDebugString(text);
}
SetWindowLongPtr(hwndDlg, GWLP_WNDPROC, (LONG_PTR)pfnWndProc);
@@ -410,7 +410,7 @@ static LRESULT CALLBACK HelpSendMessageHookProc(int code, WPARAM wParam, LPARAM }
{
TCHAR text[64];
- mir_sntprintf(text, sizeof(text), _T("hooked window 0x%X for context help\n"), msg->hwnd);
+ mir_sntprintf(text, _countof(text), _T("hooked window 0x%X for context help\n"), msg->hwnd);
OutputDebugString(text);
}
break;
diff --git a/plugins/ContextHelp/src/helppack.cpp b/plugins/ContextHelp/src/helppack.cpp index 5b702c13e2..71f6e50de0 100644 --- a/plugins/ContextHelp/src/helppack.cpp +++ b/plugins/ContextHelp/src/helppack.cpp @@ -337,7 +337,7 @@ BOOL EnumPacks(ENUM_PACKS_CALLBACK callback, const TCHAR *pszFilePattern, const /* get data */
ZeroMemory(&pack, sizeof(pack));
- lstrcpy(pack.szFileName, CharLower(wfd.cFileName)); /* buffer safe */
+ mir_tstrncpy(pack.szFileName, CharLower(wfd.cFileName), _countof(pack.szFileName)); /* buffer safe */
if (LoadPackData(&pack, FALSE, pszFileVersionHeader)) {
pack.ftFileDate = wfd.ftLastWriteTime;
fPackFound = TRUE;
@@ -423,7 +423,7 @@ void CorrectPacks(const TCHAR *pszFilePattern, const TCHAR *pszDefaultFile, BOOL BOOL fDirCreated = FALSE, fOneEnabled = FALSE;
/* main path */
- if (!GetModuleFileName(NULL, szDir, sizeof(szDir)))
+ if (!GetModuleFileName(NULL, szDir, _countof(szDir)))
return;
pszFile = _tcsrchr(szDir, _T('\\'));
if (pszFile != NULL)
|