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 --- protocols/IcqOscarJ/src/dlgproc.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'protocols/IcqOscarJ/src/dlgproc.cpp') diff --git a/protocols/IcqOscarJ/src/dlgproc.cpp b/protocols/IcqOscarJ/src/dlgproc.cpp index 704764c848..3b0cc7f6ab 100644 --- a/protocols/IcqOscarJ/src/dlgproc.cpp +++ b/protocols/IcqOscarJ/src/dlgproc.cpp @@ -125,7 +125,7 @@ char* ChangeInfoData::GetItemSettingText(int i, char *buf, size_t bufsize) void ChangeInfoData::PaintItemSetting(HDC hdc, RECT *rc, int i, UINT itemState) { char str[MAX_PATH]; - char *text = GetItemSettingText(i, str, SIZEOF(str)); + char *text = GetItemSettingText(i, str, _countof(str)); const SettingItem &si = setting[i]; SettingItemData &sid = settingData[i]; @@ -204,7 +204,7 @@ INT_PTR CALLBACK ChangeInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TCHAR text[MAX_PATH]; lvi.lParam = lvi.iItem; lvi.pszText = text; - utf8_to_tchar_static(setting[lvi.iItem].szDescription, text, SIZEOF(text)); + utf8_to_tchar_static(setting[lvi.iItem].szDescription, text, _countof(text)); ListView_InsertItem(dat->hwndList, &lvi); } } @@ -467,17 +467,17 @@ INT_PTR CALLBACK ChangeInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (ack->type != ACKTYPE_SETINFO) break; if (ack->result == ACKRESULT_SUCCESS) { - for (i = 0; i < SIZEOF(dat->hUpload); i++) + for (i = 0; i < _countof(dat->hUpload); i++) if (dat->hUpload[i] && ack->hProcess == dat->hUpload[i]) break; - if (i == SIZEOF(dat->hUpload)) break; + if (i == _countof(dat->hUpload)) break; dat->hUpload[i] = NULL; - for (done = 0, i = 0; i < SIZEOF(dat->hUpload); i++) + for (done = 0, i = 0; i < _countof(dat->hUpload); i++) done += dat->hUpload[i] == NULL; TCHAR buf[MAX_PATH]; - mir_sntprintf(buf, TranslateT("Upload in progress...%d%%"), 100 * done / (SIZEOF(dat->hUpload))); + mir_sntprintf(buf, TranslateT("Upload in progress...%d%%"), 100 * done / (_countof(dat->hUpload))); SetDlgItemText(hwndDlg, IDC_UPLOADING, buf); - if (done < SIZEOF(dat->hUpload)) break; + if (done < _countof(dat->hUpload)) break; dat->ClearChangeFlags(); UnhookEvent(dat->hAckHook); -- cgit v1.2.3