summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_search.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-19 19:35:42 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-19 19:35:42 +0000
commit4c814798c7bc7f6a0f92c21b027b26290622aa2f (patch)
tree9bbfb38bd639f352300aa16ff7c45f5a9b2dba6d /protocols/JabberG/src/jabber_search.cpp
parentf0f0cd088f1ec3a85abee825ddbc214f3f6b92c3 (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 'protocols/JabberG/src/jabber_search.cpp')
-rw-r--r--protocols/JabberG/src/jabber_search.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp
index af1ebda659..87fcc15b21 100644
--- a/protocols/JabberG/src/jabber_search.cpp
+++ b/protocols/JabberG/src/jabber_search.cpp
@@ -461,7 +461,7 @@ int CJabberProto::SearchRenewFields(HWND hwndDlg, JabberSearchData *dat)
{
TCHAR szServerName[100];
EnableWindow(GetDlgItem(hwndDlg, IDC_GO), FALSE);
- GetDlgItemText(hwndDlg, IDC_SERVER, szServerName, SIZEOF(szServerName));
+ GetDlgItemText(hwndDlg, IDC_SERVER, szServerName, _countof(szServerName));
dat->CurrentHeight = 0;
dat->curPos = 0;
SetScrollPos(GetDlgItem(hwndDlg, IDC_VSCROLL), SB_CTL, 0, FALSE);
@@ -493,21 +493,21 @@ void CJabberProto::SearchDeleteFromRecent(const TCHAR *szAddr, BOOL deleteLastFr
//search in recent
for (int i = 0; i < 10; i++) {
char key[30];
- mir_snprintf(key, SIZEOF(key), "RecentlySearched_%d", i);
+ mir_snprintf(key, _countof(key), "RecentlySearched_%d", i);
ptrT szValue(getTStringA(key));
if (szValue == NULL || mir_tstrcmpi(szAddr, szValue))
continue;
for (int j = i; j < 10; j++) {
- mir_snprintf(key, SIZEOF(key), "RecentlySearched_%d", j + 1);
+ mir_snprintf(key, _countof(key), "RecentlySearched_%d", j + 1);
szValue = getTStringA(key);
if (szValue != NULL) {
- mir_snprintf(key, SIZEOF(key), "RecentlySearched_%d", j);
+ mir_snprintf(key, _countof(key), "RecentlySearched_%d", j);
setTString(NULL, key, szValue);
}
else {
if (deleteLastFromDB) {
- mir_snprintf(key, SIZEOF(key), "RecentlySearched_%d", j);
+ mir_snprintf(key, _countof(key), "RecentlySearched_%d", j);
delSetting(NULL, key);
}
break;
@@ -523,15 +523,15 @@ void CJabberProto::SearchAddToRecent(const TCHAR *szAddr, HWND hwndDialog)
SearchDeleteFromRecent(szAddr);
for (int j = 9; j > 0; j--) {
- mir_snprintf(key, SIZEOF(key), "RecentlySearched_%d", j - 1);
+ mir_snprintf(key, _countof(key), "RecentlySearched_%d", j - 1);
ptrT szValue(getTStringA(key));
if (szValue != NULL) {
- mir_snprintf(key, SIZEOF(key), "RecentlySearched_%d", j);
+ mir_snprintf(key, _countof(key), "RecentlySearched_%d", j);
setTString(NULL, key, szValue);
}
}
- mir_snprintf(key, SIZEOF(key), "RecentlySearched_%d", 0);
+ mir_snprintf(key, _countof(key), "RecentlySearched_%d", 0);
setTString(key, szAddr);
if (hwndDialog)
JabberSearchAddUrlToRecentCombo(hwndDialog, szAddr);
@@ -563,7 +563,7 @@ static INT_PTR CALLBACK JabberSearchAdvancedDlgProc(HWND hwndDlg, UINT msg, WPAR
for (i = 0; i < 10; i++) {
char key[30];
- mir_snprintf(key, SIZEOF(key), "RecentlySearched_%d", i);
+ mir_snprintf(key, _countof(key), "RecentlySearched_%d", i);
ptrT szValue(dat->ppro->getTStringA(key));
if (szValue != NULL)
JabberSearchAddUrlToRecentCombo(hwndDlg, szValue);
@@ -743,7 +743,7 @@ HWND __cdecl CJabberProto::SearchAdvanced(HWND hwndDlg)
// get server name
TCHAR szServerName[100];
- GetDlgItemText(hwndDlg, IDC_SERVER, szServerName, SIZEOF(szServerName));
+ GetDlgItemText(hwndDlg, IDC_SERVER, szServerName, _countof(szServerName));
// formating query
CJabberIqInfo *pInfo = AddIQ(&CJabberProto::OnIqResultAdvancedSearch, JABBER_IQ_TYPE_SET, szServerName);
@@ -764,7 +764,7 @@ HWND __cdecl CJabberProto::SearchAdvanced(HWND hwndDlg)
else { //and Simple fields: XEP-0055 Example 3
for (int i = 0; i < dat->nJSInfCount; i++) {
TCHAR szFieldValue[100];
- GetWindowText(dat->pJSInf[i].hwndValueItem, szFieldValue, SIZEOF(szFieldValue));
+ GetWindowText(dat->pJSInf[i].hwndValueItem, szFieldValue, _countof(szFieldValue));
if (szFieldValue[0] != 0) {
xmlAddChild(query, dat->pJSInf[i].szFieldName, szFieldValue);
fRequestNotEmpty = TRUE;