From 4c814798c7bc7f6a0f92c21b027b26290622aa2f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 19 Jun 2015 19:35:42 +0000 Subject: SIZEOF replaced with more secure analog - _countof git-svn-id: http://svn.miranda-ng.org/main/trunk@14270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Weather/src/weather_opt.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'plugins/Weather/src/weather_opt.cpp') diff --git a/plugins/Weather/src/weather_opt.cpp b/plugins/Weather/src/weather_opt.cpp index 77cc37b97a..691defdd08 100644 --- a/plugins/Weather/src/weather_opt.cpp +++ b/plugins/Weather/src/weather_opt.cpp @@ -373,14 +373,14 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) } // get update time and remove the old timer - GetDlgItemText(hdlg, IDC_UPDATETIME, str, SIZEOF(str)); + GetDlgItemText(hdlg, IDC_UPDATETIME, str, _countof(str)); opt.UpdateTime = (WORD)_ttoi(str); if (opt.UpdateTime < 1) opt.UpdateTime = 1; KillTimer(NULL, timerId); timerId = SetTimer(NULL, 0, opt.UpdateTime * 60000, (TIMERPROC)timerProc); // other general options - GetDlgItemText(hdlg, IDC_DEGREE, opt.DegreeSign, SIZEOF(opt.DegreeSign)); + GetDlgItemText(hdlg, IDC_DEGREE, opt.DegreeSign, _countof(opt.DegreeSign)); opt.StartupUpdate = IsDlgButtonChecked(hdlg, IDC_STARTUPUPD); opt.AutoUpdate = IsDlgButtonChecked(hdlg, IDC_UPDATE); opt.NoProtoCondition = BST_UNCHECKED == IsDlgButtonChecked(hdlg, IDC_PROTOCOND); @@ -472,7 +472,7 @@ INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) SetWindowPos(hdlg, HWND_TOPMOST, rc.left, rc.top, 0, 0, SWP_NOSIZE); TranslateDialogDefault(hdlg); // generate the display text for variable list - _tcsncpy(str, VAR_LIST_OPT, SIZEOF(str) - 1); + _tcsncpy(str, VAR_LIST_OPT, _countof(str) - 1); SetDlgItemText(hdlg, IDC_VARLIST, str); // make the more variable and other buttons flat @@ -578,21 +578,21 @@ INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) // free memory for old settings FreeTextVar(); // save new settings to memory - GetDlgItemText(hdlg, IDC_CTEXT, textstr, SIZEOF(textstr)); + GetDlgItemText(hdlg, IDC_CTEXT, textstr, _countof(textstr)); wSetData(&opt.cText, textstr); - GetDlgItemText(hdlg, IDC_BTEXT, textstr, SIZEOF(textstr)); + GetDlgItemText(hdlg, IDC_BTEXT, textstr, _countof(textstr)); wSetData(&opt.bText, textstr); - GetDlgItemText(hdlg, IDC_BTITLE, textstr, SIZEOF(textstr)); + GetDlgItemText(hdlg, IDC_BTITLE, textstr, _countof(textstr)); wSetData(&opt.bTitle, textstr); - GetDlgItemText(hdlg, IDC_ETEXT, textstr, SIZEOF(textstr)); + GetDlgItemText(hdlg, IDC_ETEXT, textstr, _countof(textstr)); wSetData(&opt.eText, textstr); - GetDlgItemText(hdlg, IDC_NTEXT, textstr, SIZEOF(textstr)); + GetDlgItemText(hdlg, IDC_NTEXT, textstr, _countof(textstr)); wSetData(&opt.nText, textstr); - GetDlgItemText(hdlg, IDC_HTEXT, textstr, SIZEOF(textstr)); + GetDlgItemText(hdlg, IDC_HTEXT, textstr, _countof(textstr)); wSetData(&opt.hText, textstr); - GetDlgItemText(hdlg, IDC_XTEXT, textstr, SIZEOF(textstr)); + GetDlgItemText(hdlg, IDC_XTEXT, textstr, _countof(textstr)); wSetData(&opt.xText, textstr); - GetDlgItemText(hdlg, IDC_BTITLE2, textstr, SIZEOF(textstr)); + GetDlgItemText(hdlg, IDC_BTITLE2, textstr, _countof(textstr)); wSetData(&opt.sText, textstr); SaveOptions(); UpdateAllInfo(0, 0); -- cgit v1.2.3