summaryrefslogtreecommitdiff
path: root/plugins/MirOTR/src
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 /plugins/MirOTR/src
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 'plugins/MirOTR/src')
-rw-r--r--plugins/MirOTR/src/dialogs.cpp14
-rw-r--r--plugins/MirOTR/src/icons.cpp2
-rw-r--r--plugins/MirOTR/src/mirotrmenu.cpp12
-rw-r--r--plugins/MirOTR/src/options.cpp22
-rw-r--r--plugins/MirOTR/src/otr.cpp30
-rw-r--r--plugins/MirOTR/src/svcs_menu.cpp2
-rw-r--r--plugins/MirOTR/src/utils.cpp8
7 files changed, 45 insertions, 45 deletions
diff --git a/plugins/MirOTR/src/dialogs.cpp b/plugins/MirOTR/src/dialogs.cpp
index c688048302..76a690976e 100644
--- a/plugins/MirOTR/src/dialogs.cpp
+++ b/plugins/MirOTR/src/dialogs.cpp
@@ -41,9 +41,9 @@ INT_PTR CALLBACK DlgSMPUpdateProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
TCHAR title[512], *proto = mir_a2t(GetContactProto(hContact));
const TCHAR *name =contact_get_nameT(hContact);
- mir_sntprintf(title, SIZEOF(title), TranslateT(LANG_SMP_PROGRESS_TITLE), name, proto);
+ mir_sntprintf(title, _countof(title), TranslateT(LANG_SMP_PROGRESS_TITLE), name, proto);
SetWindowText(hwndDlg, title);
- mir_sntprintf(title, SIZEOF(title), TranslateT(LANG_SMP_PROGRESS_DESC), name, proto);
+ mir_sntprintf(title, _countof(title), TranslateT(LANG_SMP_PROGRESS_DESC), name, proto);
mir_free(proto);
SetDlgItemText(hwndDlg, IDC_STC_SMP_HEADPRO, title);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)context);
@@ -328,7 +328,7 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
MCONTACT hContact = (MCONTACT)context->app_data;
TCHAR title[512], *proto = mir_a2t(GetContactProto(hContact));
- mir_sntprintf(title, SIZEOF(title), TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto);
+ mir_sntprintf(title, _countof(title), TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto);
mir_free(proto);
SetWindowText(hwndDlg, title);
SetDlgItemText(hwndDlg, IDC_STC_SMP_HEAD, title);
@@ -421,7 +421,7 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
if (_tcsncmp(msg, TranslateT(LANG_SMPTYPE_QUESTION), 255)==0) {
if (smp_for_contact.find(context->app_data) != smp_for_contact.end()) {
TCHAR msg[512];
- mir_sntprintf(msg, SIZEOF(msg), TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact));
+ mir_sntprintf(msg, _countof(msg), TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact));
ShowError(msg);
}else {
int len = SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD1, WM_GETTEXTLENGTH, 0, 0);
@@ -443,7 +443,7 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
}else if (_tcsncmp(msg, TranslateT(LANG_SMPTYPE_PASSWORD), 255)==0) {
if (smp_for_contact.find(context->app_data) != smp_for_contact.end()) {
TCHAR msg[512];
- mir_sntprintf(msg, SIZEOF(msg), TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact));
+ mir_sntprintf(msg, _countof(msg), TranslateT(LANG_SMP_IN_PROGRESS), contact_get_nameT(hContact));
ShowError(msg);
}else {
int len = SendDlgItemMessage(hwndDlg, IDC_EDT_SMP_FIELD2, WM_GETTEXTLENGTH, 0, 0);
@@ -737,7 +737,7 @@ unsigned int CALLBACK verify_context_thread(void *param)
lib_cs_lock();
otrl_context_set_trust(context->active_fingerprint, "verified");
otrl_privkey_write_fingerprints(otr_user_state, _T2A(g_fingerprint_store_filename));
- mir_sntprintf(msg, SIZEOF(msg), TranslateT(LANG_FINGERPRINT_VERIFIED), contact_get_nameT(hContact));
+ mir_sntprintf(msg, _countof(msg), TranslateT(LANG_FINGERPRINT_VERIFIED), contact_get_nameT(hContact));
ShowMessage(hContact, msg);
SetEncryptionStatus(hContact, otr_context_get_trust(context));
break;
@@ -745,7 +745,7 @@ unsigned int CALLBACK verify_context_thread(void *param)
lib_cs_lock();
otrl_context_set_trust(context->active_fingerprint, NULL);
otrl_privkey_write_fingerprints(otr_user_state, _T2A(g_fingerprint_store_filename));
- mir_sntprintf(msg, SIZEOF(msg), TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact));
+ mir_sntprintf(msg, _countof(msg), TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact));
ShowMessage(hContact, msg);
SetEncryptionStatus(hContact, otr_context_get_trust(context));
break;
diff --git a/plugins/MirOTR/src/icons.cpp b/plugins/MirOTR/src/icons.cpp
index fa92c1804c..9b952736b1 100644
--- a/plugins/MirOTR/src/icons.cpp
+++ b/plugins/MirOTR/src/icons.cpp
@@ -11,5 +11,5 @@ static IconItem iconList[] = {
void InitIcons()
{
- Icon_Register(hInst, "OTR", iconList, SIZEOF(iconList));
+ Icon_Register(hInst, "OTR", iconList, _countof(iconList));
}
diff --git a/plugins/MirOTR/src/mirotrmenu.cpp b/plugins/MirOTR/src/mirotrmenu.cpp
index 6c685d11f8..4cab62e690 100644
--- a/plugins/MirOTR/src/mirotrmenu.cpp
+++ b/plugins/MirOTR/src/mirotrmenu.cpp
@@ -107,17 +107,17 @@ INT_PTR MirOTRMenuCheckService(WPARAM wParam,LPARAM)
switch (level) {
case TRUST_PRIVATE:{
mi.hIcolibItem = IcoLib_GetIconHandle(ICON_PRIVATE);
- mir_tstrncpy(text,TranslateT(LANG_STATUS_PRIVATE),SIZEOF(text));
+ mir_tstrncpy(text,TranslateT(LANG_STATUS_PRIVATE),_countof(text));
size_t len = mir_tstrlen(text);
- if(len < SIZEOF(text))
- mir_sntprintf(text+len, SIZEOF(text)-len, _T(" [v%i]"), context->protocol_version);
+ if(len < _countof(text))
+ mir_sntprintf(text+len, _countof(text)-len, _T(" [v%i]"), context->protocol_version);
break;}
case TRUST_UNVERIFIED:{
mi.hIcolibItem = IcoLib_GetIconHandle(ICON_UNVERIFIED);
- mir_tstrncpy(text,TranslateT(LANG_STATUS_UNVERIFIED),SIZEOF(text));
+ mir_tstrncpy(text,TranslateT(LANG_STATUS_UNVERIFIED),_countof(text));
size_t len = mir_tstrlen(text);
- if(len < SIZEOF(text))
- mir_sntprintf(text+len, SIZEOF(text)-len, _T(" [v%i]"), context->protocol_version);
+ if(len < _countof(text))
+ mir_sntprintf(text+len, _countof(text)-len, _T(" [v%i]"), context->protocol_version);
break;}
case TRUST_FINISHED:
mi.hIcolibItem = IcoLib_GetIconHandle(ICON_FINISHED);
diff --git a/plugins/MirOTR/src/options.cpp b/plugins/MirOTR/src/options.cpp
index 5178e6cf25..ef55726f0c 100644
--- a/plugins/MirOTR/src/options.cpp
+++ b/plugins/MirOTR/src/options.cpp
@@ -37,7 +37,7 @@ void SetFilenames(const TCHAR *path)
int FoldersChanged(WPARAM wParam, LPARAM lParam)
{
TCHAR path[MAX_PATH];
- if ( FoldersGetCustomPathT(hPATH_MIROTR, path, SIZEOF(path), _T("")))
+ if ( FoldersGetCustomPathT(hPATH_MIROTR, path, _countof(path), _T("")))
SetFilenames( VARST(DATA_DIRECTORY));
else
SetFilenames(path);
@@ -352,7 +352,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP
if (sel != -1) {
PROTOREGENKEYOPTIONS *opts = new PROTOREGENKEYOPTIONS();
opts->refresh = hwndDlg;
- ListView_GetItemText(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS), sel, 0, opts->proto, SIZEOF(opts->proto));
+ ListView_GetItemText(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS), sel, 0, opts->proto, _countof(opts->proto));
CloseHandle((HANDLE)_beginthreadex(0, 0, regen_key_thread, opts, 0, 0));
}
break;
@@ -361,7 +361,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP
sel = ListView_GetSelectionMark(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS));
if (sel != -1) {
TCHAR buff_proto[128];
- ListView_GetItemText(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS), sel, 0, buff_proto, SIZEOF(buff_proto));
+ ListView_GetItemText(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS), sel, 0, buff_proto, _countof(buff_proto));
TCHAR buff[512];
mir_sntprintf(buff, TranslateT(LANG_OTR_ASK_REMOVEKEY), buff_proto);
if (IDYES == MessageBox(hwndDlg, buff, TranslateT(LANG_OTR_INFO), MB_ICONQUESTION | MB_YESNO)) {
@@ -416,7 +416,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_PROTO_NEWKEY), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_PROTO_FORGET), TRUE);
TCHAR buff[50];
- ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, notif->iItem, 1, buff, SIZEOF(buff));
+ ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, notif->iItem, 1, buff, _countof(buff));
SendDlgItemMessage(hwndDlg, IDC_CMB_PROTO_POLICY, CB_SELECTSTRING, (LPARAM)-1, (WPARAM)buff);
}
}
@@ -428,7 +428,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP
if (proto == NULL)
continue;
- ListView_GetItemText(lv, i, 1, policy, SIZEOF(policy));
+ ListView_GetItemText(lv, i, 1, policy, _countof(policy));
db_set_dw(0, MODULENAME"_ProtoPol", proto, policy_from_string(policy));
}
// handle apply
@@ -579,7 +579,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM
else {
EnableWindow(GetDlgItem(hwndDlg, IDC_CMB_CONT_POLICY), TRUE);
TCHAR buff[50];
- ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, notif->iItem, 2, buff, SIZEOF(buff));
+ ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, notif->iItem, 2, buff, _countof(buff));
SendDlgItemMessage(hwndDlg, IDC_CMB_CONT_POLICY, CB_SELECTSTRING, (LPARAM)-1, (WPARAM)buff);
}
}
@@ -595,7 +595,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM
MCONTACT hContact = (MCONTACT)lvi.lParam;
ContactPolicyMap *cp = (ContactPolicyMap *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
TCHAR buff[50];
- ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, lvi.iItem, 3, buff, SIZEOF(buff));
+ ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, lvi.iItem, 3, buff, _countof(buff));
if (_tcsncmp(buff, TranslateT(LANG_YES), 50) == 0) {
(*cp)[hContact].htmlconv = HTMLCONV_DISABLE;
ListView_SetItemText(((LPNMHDR)lParam)->hwndFrom, lvi.iItem, 3, TranslateT(LANG_NO));
@@ -750,8 +750,8 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w
TCHAR buff[1024], hash[45];
otrl_privkey_hash_to_humanT(hash, fp->fingerprint);
PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact));
- mir_sntprintf(buff, SIZEOF(buff) - 1, TranslateT(LANG_FINGERPRINT_STILL_IN_USE), hash, contact_get_nameT(hContact), pa->tszAccountName);
- buff[SIZEOF(buff) - 1] = '\0';
+ mir_sntprintf(buff, _countof(buff) - 1, TranslateT(LANG_FINGERPRINT_STILL_IN_USE), hash, contact_get_nameT(hContact), pa->tszAccountName);
+ buff[_countof(buff) - 1] = '\0';
ShowError(buff);
}
else {
@@ -781,8 +781,8 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w
TCHAR buff[1024], hash[45];
otrl_privkey_hash_to_humanT(hash, it->first->fingerprint);
PROTOACCOUNT *pa = Proto_GetAccount(GetContactProto(hContact));
- mir_sntprintf(buff, SIZEOF(buff) - 1, TranslateT(LANG_FINGERPRINT_NOT_DELETED), hash, contact_get_nameT(hContact), pa->tszAccountName);
- buff[SIZEOF(buff) - 1] = '\0';
+ mir_sntprintf(buff, _countof(buff) - 1, TranslateT(LANG_FINGERPRINT_NOT_DELETED), hash, contact_get_nameT(hContact), pa->tszAccountName);
+ buff[_countof(buff) - 1] = '\0';
ShowError(buff);
}
else otrl_context_forget_fingerprint(it->first, 1);
diff --git a/plugins/MirOTR/src/otr.cpp b/plugins/MirOTR/src/otr.cpp
index 9d5a690cd3..b7ee6b3963 100644
--- a/plugins/MirOTR/src/otr.cpp
+++ b/plugins/MirOTR/src/otr.cpp
@@ -182,7 +182,7 @@ extern "C" {
if (context->protocol_version < MIROTR_PROTO_LATEST){
size_t remaining = mir_tstrlen(buff);
TCHAR *offset = buff + remaining;
- remaining = SIZEOF(buff) - remaining;
+ remaining = _countof(buff) - remaining;
mir_sntprintf(offset, remaining, TranslateT("\nusing older protocol version %i"), context->protocol_version);
}
ShowMessage(hContact, buff);
@@ -314,68 +314,68 @@ extern "C" {
break;
case OTRL_MSGEVENT_ENCRYPTION_REQUIRED:
msgfunc = ShowMessageInline;
- mir_tstrncpy(msg, TranslateT("Attempting to start a private conversation..."), SIZEOF(msg));
+ mir_tstrncpy(msg, TranslateT("Attempting to start a private conversation..."), _countof(msg));
break;
case OTRL_MSGEVENT_ENCRYPTION_ERROR:
msgfunc = ShowMessageInline;
- mir_tstrncpy(msg, TranslateT("An error occurred when encrypting your message.\nThe message was not sent"), SIZEOF(msg));
+ mir_tstrncpy(msg, TranslateT("An error occurred when encrypting your message.\nThe message was not sent"), _countof(msg));
break;
case OTRL_MSGEVENT_CONNECTION_ENDED:
msgfunc = ShowMessageInline;
- mir_snwprintf(msg, SIZEOF(msg), TranslateT("'%s' has already closed his/her private connection to you; you should do the same"), contact);
+ mir_snwprintf(msg, _countof(msg), TranslateT("'%s' has already closed his/her private connection to you; you should do the same"), contact);
break;
case OTRL_MSGEVENT_SETUP_ERROR:
// title = TranslateT("OTR Error");
if (!err) err = GPG_ERR_INV_VALUE;
switch (gcry_err_code(err)){
case GPG_ERR_INV_VALUE:
- mir_snwprintf(msg, SIZEOF(msg), TranslateT("Error setting up private conversation: %s"), TranslateT("Malformed message received"));
+ mir_snwprintf(msg, _countof(msg), TranslateT("Error setting up private conversation: %s"), TranslateT("Malformed message received"));
break;
default:{
TCHAR* tmp = mir_utf8decodeT(gcry_strerror(err));
- mir_snwprintf(msg, SIZEOF(msg), TranslateT("Error setting up private conversation: %s"), tmp);
+ mir_snwprintf(msg, _countof(msg), TranslateT("Error setting up private conversation: %s"), tmp);
mir_free(tmp); }
}
break;
case OTRL_MSGEVENT_MSG_REFLECTED:
// title = TranslateT("OTR Error");
- mir_tstrncpy(msg, TranslateT("We are receiving our own OTR messages.\nYou are either trying to talk to yourself, or someone is reflecting your messages back at you"), SIZEOF(msg));
+ mir_tstrncpy(msg, TranslateT("We are receiving our own OTR messages.\nYou are either trying to talk to yourself, or someone is reflecting your messages back at you"), _countof(msg));
break;
case OTRL_MSGEVENT_MSG_RESENT:
// title = TranslateT("Message resent");
- mir_snwprintf(msg, SIZEOF(msg), TranslateT("The last message to '%s' was resent"), contact);
+ mir_snwprintf(msg, _countof(msg), TranslateT("The last message to '%s' was resent"), contact);
break;
case OTRL_MSGEVENT_RCVDMSG_NOT_IN_PRIVATE:
// title = TranslateT("Unreadable message");
- mir_snwprintf(msg, SIZEOF(msg), TranslateT("The encrypted message received from '%s' is unreadable, as you are not currently communicating privately"), contact);
+ mir_snwprintf(msg, _countof(msg), TranslateT("The encrypted message received from '%s' is unreadable, as you are not currently communicating privately"), contact);
break;
case OTRL_MSGEVENT_RCVDMSG_UNREADABLE:
// title = TranslateT("OTR Error");
- mir_snwprintf(msg, SIZEOF(msg), TranslateT("We received an unreadable encrypted message from '%s'"), contact);
+ mir_snwprintf(msg, _countof(msg), TranslateT("We received an unreadable encrypted message from '%s'"), contact);
break;
case OTRL_MSGEVENT_RCVDMSG_MALFORMED:
// title = TranslateT("OTR Error");
- mir_snwprintf(msg, SIZEOF(msg), TranslateT("We received a malformed data message from '%s'"), contact);
+ mir_snwprintf(msg, _countof(msg), TranslateT("We received a malformed data message from '%s'"), contact);
break;
case OTRL_MSGEVENT_RCVDMSG_GENERAL_ERR:{
// title = TranslateT("OTR Error");
TCHAR* tmp = mir_utf8decodeT(message);
- mir_tstrncpy(msg, tmp, SIZEOF(msg));
+ mir_tstrncpy(msg, tmp, _countof(msg));
mir_free(tmp);
break; }
case OTRL_MSGEVENT_RCVDMSG_UNENCRYPTED:{
// title = TranslateT("Received unencrypted message");
TCHAR* tmp = mir_utf8decodeT(message);
- mir_snwprintf(msg, SIZEOF(msg), TranslateT("The following message received from '%s' was NOT encrypted: [%s]"), contact, tmp);
+ mir_snwprintf(msg, _countof(msg), TranslateT("The following message received from '%s' was NOT encrypted: [%s]"), contact, tmp);
mir_free(tmp);
break; }
case OTRL_MSGEVENT_RCVDMSG_FOR_OTHER_INSTANCE:
// title = TranslateT("Received message for a different session");
- mir_snwprintf(msg, SIZEOF(msg), TranslateT("'%s' has sent a message intended for a different session. If you are logged in multiple times, another session may have received the message."), contact);
+ mir_snwprintf(msg, _countof(msg), TranslateT("'%s' has sent a message intended for a different session. If you are logged in multiple times, another session may have received the message."), contact);
break;
default:
// title = TranslateT("OTR Error");
- mir_tstrncpy(msg, TranslateT("unknown OTR message received, please report that to Miranda NG"), SIZEOF(msg));
+ mir_tstrncpy(msg, TranslateT("unknown OTR message received, please report that to Miranda NG"), _countof(msg));
}
if (msg[0])
msgfunc(hContact, msg);
diff --git a/plugins/MirOTR/src/svcs_menu.cpp b/plugins/MirOTR/src/svcs_menu.cpp
index d5837ae2bc..e3e33c5adb 100644
--- a/plugins/MirOTR/src/svcs_menu.cpp
+++ b/plugins/MirOTR/src/svcs_menu.cpp
@@ -22,7 +22,7 @@ int StartOTR(MCONTACT hContact) {
TCHAR* nick=ProtoGetNickname(proto);
if(nick){
TCHAR msg[1024];
- TCHAR* msgend = msg+SIZEOF(msg)-1;
+ TCHAR* msgend = msg+_countof(msg)-1;
TCHAR* msgoff = msg;
for(const char* c=MIROTR_PROTO_HELLO; *c; *msgoff++=*c++);
*msgoff++ = '\n';
diff --git a/plugins/MirOTR/src/utils.cpp b/plugins/MirOTR/src/utils.cpp
index 0dfc5a2407..d8e5e968e1 100644
--- a/plugins/MirOTR/src/utils.cpp
+++ b/plugins/MirOTR/src/utils.cpp
@@ -68,7 +68,7 @@ void VerifyFingerprintMessage(ConnContext *context, bool verify) {
MCONTACT hContact = (MCONTACT)context->app_data;
TCHAR msg[1024];
- mir_sntprintf(msg, SIZEOF(msg), (verify)?TranslateT(LANG_FINGERPRINT_VERIFIED):TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact));
+ mir_sntprintf(msg, _countof(msg), (verify)?TranslateT(LANG_FINGERPRINT_VERIFIED):TranslateT(LANG_FINGERPRINT_NOT_VERIFIED), contact_get_nameT(hContact));
ShowMessage(hContact, msg);
SetEncryptionStatus(hContact, otr_context_get_trust(context));
}
@@ -155,7 +155,7 @@ void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const MCONTA
if ( !options.bHavePopups) {
TCHAR title[256];
- mir_sntprintf(title, SIZEOF(title), _T("%s Message"), _T(MODULENAME));
+ mir_sntprintf(title, _countof(title), _T("%s Message"), _T(MODULENAME));
if(line1 && line2) {
int size = int(mir_tstrlen(line1) + mir_tstrlen(line2) + 3);
@@ -205,7 +205,7 @@ void ShowWarning(TCHAR *msg) {
if(disp == ED_POP && !options.bHavePopups) disp = ED_BAL;
if(disp == ED_BAL && !ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) disp = ED_MB;
- mir_sntprintf(buffer, SIZEOF(buffer), _T("%s Warning"), _T(MODULENAME));
+ mir_sntprintf(buffer, _countof(buffer), _T("%s Warning"), _T(MODULENAME));
TCHAR *message;
switch(disp) {
@@ -251,7 +251,7 @@ void ShowError(TCHAR *msg) {
if(disp == ED_POP && !options.bHavePopups) disp = ED_BAL;
if(disp == ED_BAL && !ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) disp = ED_MB;
- mir_sntprintf(buffer, SIZEOF(buffer), _T("%s Error"), _T(MODULENAME));
+ mir_sntprintf(buffer, _countof(buffer), _T("%s Error"), _T(MODULENAME));
TCHAR *message;