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/Weather/src/weather_popup.cpp | |
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/Weather/src/weather_popup.cpp')
-rw-r--r-- | plugins/Weather/src/weather_popup.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/plugins/Weather/src/weather_popup.cpp b/plugins/Weather/src/weather_popup.cpp index 3b08a3c1a5..8e5397ac0d 100644 --- a/plugins/Weather/src/weather_popup.cpp +++ b/plugins/Weather/src/weather_popup.cpp @@ -79,8 +79,8 @@ int WeatherError(WPARAM wParam, LPARAM lParam) TCHAR str1[512], str2[512];
// get the 2 strings
- _tcsncpy(str1, tszMsg, SIZEOF(str1) - 1);
- _tcsncpy(str2, tszMsg, SIZEOF(str2) - 1);
+ _tcsncpy(str1, tszMsg, _countof(str1) - 1);
+ _tcsncpy(str2, tszMsg, _countof(str2) - 1);
TCHAR *chop = _tcschr(str1, 255);
if (chop != NULL)
*chop = '\0';
@@ -88,7 +88,7 @@ int WeatherError(WPARAM wParam, LPARAM lParam) str1[0] = 0;
chop = _tcschr(str2, 255);
if (chop != NULL)
- _tcsncpy(str2, chop+1, SIZEOF(str2) - 1);
+ _tcsncpy(str2, chop+1, _countof(str2) - 1);
else
str2[0] = 0;
@@ -222,7 +222,7 @@ void ReadPopupOpt(HWND hdlg) opt.BGColour = SendDlgItemMessage(hdlg,IDC_BGCOLOUR,CPM_GETCOLOUR,0,0);
// get delay time
- GetDlgItemText(hdlg, IDC_DELAY, str, SIZEOF(str));
+ GetDlgItemText(hdlg, IDC_DELAY, str, _countof(str));
int num = _ttoi(str);
opt.pDelay = num;
@@ -237,9 +237,9 @@ void ReadPopupOpt(HWND hdlg) // popup texts
wfree(&opt.pText);
wfree(&opt.pTitle);
- GetDlgItemText(hdlg, IDC_PText, text, SIZEOF(text));
+ GetDlgItemText(hdlg, IDC_PText, text, _countof(text));
wSetData(&opt.pText, text);
- GetDlgItemText(hdlg, IDC_PTitle, text, SIZEOF(text));
+ GetDlgItemText(hdlg, IDC_PTitle, text, _countof(text));
wSetData(&opt.pTitle, text);
}
@@ -261,9 +261,9 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) // click actions
hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_PMENU));
hMenu1 = GetSubMenu(hMenu, 0);
- GetMenuString(hMenu1, opt.LeftClickAction, str, SIZEOF(str), MF_BYCOMMAND);
+ GetMenuString(hMenu1, opt.LeftClickAction, str, _countof(str), MF_BYCOMMAND);
SetDlgItemText(hdlg, IDC_LeftClick, TranslateTS(str));
- GetMenuString(hMenu1, opt.RightClickAction, str, SIZEOF(str), MF_BYCOMMAND);
+ GetMenuString(hMenu1, opt.RightClickAction, str, _countof(str), MF_BYCOMMAND);
SetDlgItemText(hdlg, IDC_RightClick, TranslateTS(str));
DestroyMenu(hMenu);
@@ -396,10 +396,10 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) case IDC_VAR3:
// display variable list
- _tcsncpy(str, _T(" \n"),SIZEOF(str) - 1); // to make the message box wider
- mir_tstrncat(str, VAR_LIST_POPUP, SIZEOF(str) - mir_tstrlen(str));
- mir_tstrncat(str, _T("\n"), SIZEOF(str) - mir_tstrlen(str));
- mir_tstrncat(str, CUSTOM_VARS, SIZEOF(str) - mir_tstrlen(str));
+ _tcsncpy(str, _T(" \n"),_countof(str) - 1); // to make the message box wider
+ mir_tstrncat(str, VAR_LIST_POPUP, _countof(str) - mir_tstrlen(str));
+ mir_tstrncat(str, _T("\n"), _countof(str) - mir_tstrlen(str));
+ mir_tstrncat(str, CUSTOM_VARS, _countof(str) - mir_tstrlen(str));
MessageBox(NULL, str, TranslateT("Variable List"), MB_OK|MB_ICONASTERISK|MB_TOPMOST);
break;
|