diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-19 19:35:42 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-19 19:35:42 +0000 |
commit | 4c814798c7bc7f6a0f92c21b027b26290622aa2f (patch) | |
tree | 9bbfb38bd639f352300aa16ff7c45f5a9b2dba6d /plugins/TranslitSwitcher/src | |
parent | f0f0cd088f1ec3a85abee825ddbc214f3f6b92c3 (diff) |
SIZEOF replaced with more secure analog - _countof
git-svn-id: http://svn.miranda-ng.org/main/trunk@14270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TranslitSwitcher/src')
-rw-r--r-- | plugins/TranslitSwitcher/src/Layoutproc.cpp | 14 | ||||
-rw-r--r-- | plugins/TranslitSwitcher/src/TranslitSwitcher.cpp | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/plugins/TranslitSwitcher/src/Layoutproc.cpp b/plugins/TranslitSwitcher/src/Layoutproc.cpp index cb0a760f49..d063b4b3ad 100644 --- a/plugins/TranslitSwitcher/src/Layoutproc.cpp +++ b/plugins/TranslitSwitcher/src/Layoutproc.cpp @@ -375,7 +375,7 @@ void SwitchLayout(bool lastword) return;
TCHAR szClassName[MAX_PATH];
- GetClassName(hwnd2, szClassName, SIZEOF(szClassName));
+ GetClassName(hwnd2, szClassName, _countof(szClassName));
if ((mir_tstrcmp(szClassName, _T("THppRichEdit.UnicodeClass")) == 0 || mir_tstrcmp(szClassName, _T("THistoryGrid.UnicodeClass")) == 0 || mir_tstrcmp(szClassName, _T("TExtHistoryGrid.UnicodeClass")) == 0 || mir_tstrcmp(szClassName, _T("Internet Explorer_Server")) == 0) && ServiceExists(MS_POPUP_SHOWMESSAGE)) { // make popup here
TCHAR buf[2048];
if (mir_tstrcmp(szClassName, _T("Internet Explorer_Server")) == 0) {
@@ -388,9 +388,9 @@ void SwitchLayout(bool lastword) event.iType = IEE_GET_SELECTION;
event.hwnd = hwnd3;
TCHAR *selected = (TCHAR *)CallService(MS_IEVIEW_EVENT, 0, (LPARAM)&event);
- mir_tstrncpy(buf, selected, SIZEOF(buf));
+ mir_tstrncpy(buf, selected, _countof(buf));
}
- else GetWindowText(hwnd2, buf, SIZEOF(buf)); // gimme, gimme, gimme...
+ else GetWindowText(hwnd2, buf, _countof(buf)); // gimme, gimme, gimme...
size_t slen = mir_tstrlen(buf);
if (slen != 0) {
@@ -429,8 +429,8 @@ void SwitchLayout(bool lastword) POPUPDATAT pd = { 0 };
pd.lchIcon = IcoLib_GetIcon("Switch Layout and Send");
- mir_tstrncpy(pd.lptzText, buf, SIZEOF(pd.lptzText));
- mir_tstrncpy(pd.lptzContactName, TranslateT("TranslitSwitcher"), SIZEOF(pd.lptzContactName));
+ mir_tstrncpy(pd.lptzText, buf, _countof(pd.lptzText));
+ mir_tstrncpy(pd.lptzContactName, TranslateT("TranslitSwitcher"), _countof(pd.lptzContactName));
PUAddPopupT(&pd);
}
}
@@ -514,7 +514,7 @@ void TranslitLayout(bool lastword) return;
TCHAR szClassName[16];
- GetClassName(hwnd2, szClassName, SIZEOF(szClassName));
+ GetClassName(hwnd2, szClassName, _countof(szClassName));
if (mir_tstrcmpi(szClassName, _T("RichEdit50W")) != 0)
return;
@@ -582,7 +582,7 @@ void InvertCase(bool lastword) TCHAR szClassName[16];
- GetClassName(hwnd2, szClassName, SIZEOF(szClassName));
+ GetClassName(hwnd2, szClassName, _countof(szClassName));
if (mir_tstrcmpi(szClassName, _T("RichEdit50W")) != 0)
return;
diff --git a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp index 4c4498dd90..6bbb673832 100644 --- a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp +++ b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp @@ -81,7 +81,7 @@ int OnModulesLoaded(WPARAM, LPARAM) {
HookEvent(ME_MSG_BUTTONPRESSED, OnButtonPressed);
if (ServiceExists(MS_BB_ADDBUTTON)) {
- Icon_Register(hInst, "TabSRMM/TranslitSwitcher", iconList, SIZEOF(iconList));
+ Icon_Register(hInst, "TabSRMM/TranslitSwitcher", iconList, _countof(iconList));
BBButton bbd = { 0 };
bbd.cbSize = sizeof(BBButton);
|