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/Tlen/src/tlen_thread.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'protocols/Tlen/src/tlen_thread.cpp') diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp index f6c86885b8..4c3c43769f 100644 --- a/protocols/Tlen/src/tlen_thread.cpp +++ b/protocols/Tlen/src/tlen_thread.cpp @@ -72,13 +72,13 @@ static INT_PTR CALLBACK TlenPasswordDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara switch (msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); - mir_snprintf(text, SIZEOF(text), Translate("Enter password for %s"), (char *) lParam); + mir_snprintf(text, _countof(text), Translate("Enter password for %s"), (char *) lParam); SetDlgItemTextA(hwndDlg, IDC_JID, text); return TRUE; case WM_COMMAND: switch (LOWORD(wParam)) { case IDOK: - GetDlgItemTextA(hwndDlg, IDC_PASSWORD, onlinePassword, SIZEOF(onlinePassword)); + GetDlgItemTextA(hwndDlg, IDC_PASSWORD, onlinePassword, _countof(onlinePassword)); //EndDialog(hwndDlg, (int) onlinePassword); //return TRUE; // Fall through @@ -207,7 +207,7 @@ void __cdecl TlenServerThread(ThreadData *info) return; } - mir_snprintf(jidStr, SIZEOF(jidStr), "%s@%s", info->username, info->server); + mir_snprintf(jidStr, _countof(jidStr), "%s@%s", info->username, info->server); db_set_s(NULL, info->proto->m_szModuleName, "jid", jidStr); if (!db_get(NULL, info->proto->m_szModuleName, "ManualHost", &dbv)) { @@ -402,7 +402,7 @@ static void TlenSendAuth(TlenProtocol *proto) { int iqId; char text[128]; char *str = TlenPasswordHash(proto->threadData->password); - mir_snprintf(text, SIZEOF(text), "%s%s", proto->threadData->streamId, str); + mir_snprintf(text, _countof(text), "%s%s", proto->threadData->streamId, str); mir_free(str); str = TlenSha1(text); char *p=TlenTextEncode(proto->threadData->username); @@ -912,7 +912,7 @@ static void TlenProcessW(XmlNode *node, ThreadData *info) char *f = TlenXmlGetAttrValue(node, "f"); if (f != NULL) { char webContactName[128]; - mir_snprintf(webContactName, SIZEOF(webContactName), Translate("%s Web Messages"), info->proto->m_szModuleName); + mir_snprintf(webContactName, _countof(webContactName), Translate("%s Web Messages"), info->proto->m_szModuleName); MCONTACT hContact = TlenHContactFromJID(info->proto, webContactName); if (hContact == NULL) { hContact = TlenDBCreateContact(info->proto, webContactName, webContactName, TRUE); @@ -1198,7 +1198,7 @@ static void TlenProcessV(XmlNode *node, ThreadData *info) char *from=TlenXmlGetAttrValue(node, "f"); if (from != NULL) { if (strchr(from, '@') == NULL) { - mir_snprintf(jid, SIZEOF(jid), "%s@%s", from, info->server); + mir_snprintf(jid, _countof(jid), "%s@%s", from, info->server); } else { strncpy_s(jid, from, _TRUNCATE); } -- cgit v1.2.3