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/QuickContacts/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/QuickContacts/src')
-rw-r--r-- | plugins/QuickContacts/src/options.cpp | 2 | ||||
-rw-r--r-- | plugins/QuickContacts/src/quickcontacts.cpp | 22 |
2 files changed, 12 insertions, 12 deletions
diff --git a/plugins/QuickContacts/src/options.cpp b/plugins/QuickContacts/src/options.cpp index e35b06d414..465d9e4682 100644 --- a/plugins/QuickContacts/src/options.cpp +++ b/plugins/QuickContacts/src/options.cpp @@ -90,7 +90,7 @@ static OptPageControl controls[] = { static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- int ret = SaveOptsDlgProc(controls, SIZEOF(controls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
+ int ret = SaveOptsDlgProc(controls, _countof(controls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
switch (msg) {
case WM_INITDIALOG:
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index 3a2ea7b491..445e641a62 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -246,7 +246,7 @@ TCHAR *GetListName(c_struct *cs) {
if (opts.group_append && cs->szgroup[0] != _T('\0'))
{
- mir_sntprintf(tmp_list_name, SIZEOF(tmp_list_name), _T("%s (%s)"), cs->szname, cs->szgroup);
+ mir_sntprintf(tmp_list_name, _countof(tmp_list_name), _T("%s (%s)"), cs->szname, cs->szgroup);
return tmp_list_name;
}
else
@@ -400,7 +400,7 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) if (db_get_ts(hMeta == NULL ? hContact : hMeta, "CList", "Group", &dbv) == 0)
{
if (dbv.ptszVal != NULL)
- mir_tstrncpy(contact->szgroup, dbv.ptszVal, SIZEOF(contact->szgroup));
+ mir_tstrncpy(contact->szgroup, dbv.ptszVal, _countof(contact->szgroup));
db_free(&dbv);
}
@@ -408,11 +408,11 @@ void LoadContacts(HWND hwndDlg, BOOL show_all) // Make contact name
TCHAR *tmp = (TCHAR *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR);
- mir_tstrncpy(contact->szname, tmp, SIZEOF(contact->szname));
+ mir_tstrncpy(contact->szname, tmp, _countof(contact->szname));
PROTOACCOUNT *acc = Proto_GetAccount(pszProto);
if (acc != NULL)
- mir_tstrncpy(contact->proto, acc->tszAccountName, SIZEOF(contact->proto));
+ mir_tstrncpy(contact->proto, acc->tszAccountName, _countof(contact->proto));
contact->hcontact = hContact;
contacts.insert(contact);
@@ -526,7 +526,7 @@ MCONTACT GetSelectedContact(HWND hwndDlg) // Now try the name
TCHAR cname[120] = _T("");
- GetDlgItemText(hwndDlg, IDC_USERNAME, cname, SIZEOF(cname));
+ GetDlgItemText(hwndDlg, IDC_USERNAME, cname, _countof(cname));
for(int loop = 0; loop < contacts.getCount(); loop++)
{
@@ -565,7 +565,7 @@ LRESULT CALLBACK EditProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) int ret = SendMessage(hdlg,EM_GETSEL,(WPARAM)&start,(LPARAM)&end);
- GetWindowText(hdlg, sztext, SIZEOF(sztext));
+ GetWindowText(hdlg, sztext, _countof(sztext));
BOOL at_end = (mir_tstrlen(sztext) == (int)end);
@@ -585,7 +585,7 @@ LRESULT CALLBACK EditProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) }
SendMessage(hdlg,EM_REPLACESEL,0,(LPARAM)sztext);
- GetWindowText(hdlg, sztext, SIZEOF(sztext));
+ GetWindowText(hdlg, sztext, _countof(sztext));
}
CheckText(hdlg, sztext, !at_end);
@@ -611,7 +611,7 @@ LRESULT CALLBACK EditProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam) }
else if (wparam == VK_DELETE)
{
- GetWindowText(hdlg, sztext, SIZEOF(sztext));
+ GetWindowText(hdlg, sztext, _countof(sztext));
CheckText(hdlg, sztext, TRUE);
}
@@ -713,7 +713,7 @@ static void FillButton(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key, HICON if (key == NULL)
full = TranslateTS(name);
else
- mir_sntprintf(tmp, SIZEOF(tmp), _T("%s (%s)"), TranslateTS(name), key);
+ mir_sntprintf(tmp, _countof(tmp), _T("%s (%s)"), TranslateTS(name), key);
SendDlgItemMessage(hwndDlg, dlgItem, BUTTONSETASFLATBTN, 0, 0);
SendDlgItemMessage(hwndDlg, dlgItem, BUTTONADDTOOLTIP, (LPARAM)full, BATF_TCHAR);
@@ -729,7 +729,7 @@ static void FillCheckbox(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key) if (key == NULL)
full = TranslateTS(name);
else
- mir_sntprintf(tmp, SIZEOF(tmp), _T("%s (%s)"), TranslateTS(name), key);
+ mir_sntprintf(tmp, _countof(tmp), _T("%s (%s)"), TranslateTS(name), key);
SetDlgItemText(hwndDlg, dlgItem, full);
}
@@ -958,7 +958,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (SendMessage(hEdit, EM_GETSEL, 0, 0) != -1)
SendMessage(hEdit, EM_REPLACESEL, 0, (LPARAM)_T(""));
- GetWindowText(hEdit, sztext, SIZEOF(sztext));
+ GetWindowText(hEdit, sztext, _countof(sztext));
// Fill combo
BOOL all = IsDlgButtonChecked(hwndDlg, IDC_SHOW_ALL_CONTACTS);
|