summaryrefslogtreecommitdiff
path: root/plugins/MirOTR/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-04 22:23:03 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-04 22:23:03 +0000
commitefd438ad7b533ba2adb4f22a1cb358ee449db825 (patch)
treea5a4a84ee1b46b8902fc646d42056d574369b85a /plugins/MirOTR/src
parent65c19c2a4f8e907c56fbdbfb5bf500f33c218574 (diff)
new mir_sntprintf templates without SIZEOF
git-svn-id: http://svn.miranda-ng.org/main/trunk@14004 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirOTR/src')
-rw-r--r--plugins/MirOTR/src/dialogs.cpp26
-rw-r--r--plugins/MirOTR/src/options.cpp4
-rw-r--r--plugins/MirOTR/src/otr.cpp22
-rw-r--r--plugins/MirOTR/src/svcs_menu.cpp8
-rw-r--r--plugins/MirOTR/src/svcs_proto.cpp2
-rw-r--r--plugins/MirOTR/src/utils.cpp2
6 files changed, 32 insertions, 32 deletions
diff --git a/plugins/MirOTR/src/dialogs.cpp b/plugins/MirOTR/src/dialogs.cpp
index 350d761d8d..c688048302 100644
--- a/plugins/MirOTR/src/dialogs.cpp
+++ b/plugins/MirOTR/src/dialogs.cpp
@@ -182,14 +182,14 @@ INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
smp_for_contact[context->app_data].responder = data->responder;
TCHAR buff[512], *proto = mir_a2t(GetContactProto(hContact));
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto);
+ mir_sntprintf(buff, TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto);
mir_free(proto);
SetWindowText(hwndDlg, buff);
SetDlgItemText(hwndDlg, IDC_STC_SMP_HEAD, buff);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)context);
if (data->question) {
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_SMPQUESTION_RESPOND_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_RESPOND_DESC), contact_get_nameT(hContact));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -208,7 +208,7 @@ INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
mir_free(data->question);
} else {
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_SMPPASSWORD_RESPOND_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_OTR_SMPPASSWORD_RESPOND_DESC), contact_get_nameT(hContact));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -382,9 +382,9 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
}
TCHAR buff[1024];
if (!fp->trust || fp->trust[0] == '\0')
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact));
else
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -488,9 +488,9 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
GetDlgItemText(hwndDlg, IDC_CBO_SMP_CHOOSE, buff, 255);
if (_tcsncmp(buff, TranslateT(LANG_SMPTYPE_QUESTION), 255)==0) {
if (trusted)
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact));
else
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -508,9 +508,9 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
ShowWindow(GetDlgItem(hwndDlg, IDNO), SW_HIDE);
} else if (_tcsncmp(buff, TranslateT(LANG_SMPTYPE_PASSWORD), 255)==0) {
if (trusted)
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_SMPPASSWORD_VERIFIED_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_OTR_SMPPASSWORD_VERIFIED_DESC), contact_get_nameT(hContact));
else
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_SMPPASSWORD_VERIFY_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_OTR_SMPPASSWORD_VERIFY_DESC), contact_get_nameT(hContact));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -528,9 +528,9 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
ShowWindow(GetDlgItem(hwndDlg, IDNO), SW_HIDE);
} else if (_tcsncmp(buff, TranslateT(LANG_SMPTYPE_FINGERPRINT), 255)==0) {
if (trusted)
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact));
else
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
@@ -672,9 +672,9 @@ INT_PTR CALLBACK DlgBoxProcVerifyContext(HWND hwndDlg, UINT msg, WPARAM wParam,
}
TCHAR buff[512];
if (!fp->trust || fp->trust[0] == '\0')
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact));
else
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact));
SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff);
diff --git a/plugins/MirOTR/src/options.cpp b/plugins/MirOTR/src/options.cpp
index 21ac240c25..697b0ba1c3 100644
--- a/plugins/MirOTR/src/options.cpp
+++ b/plugins/MirOTR/src/options.cpp
@@ -242,7 +242,7 @@ static unsigned int CALLBACK regen_key_thread(void* param)
PROTOREGENKEYOPTIONS *opts = (PROTOREGENKEYOPTIONS *)param;
TCHAR buff[512];
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_ASK_NEWKEY), opts->proto);
+ mir_sntprintf(buff, TranslateT(LANG_OTR_ASK_NEWKEY), opts->proto);
EnableWindow(opts->refresh, FALSE);
if (IDYES == MessageBox(opts->refresh, buff, TranslateT(LANG_OTR_INFO), MB_ICONQUESTION|MB_YESNO)) {
char* proto = mir_t2a(opts->proto);
@@ -363,7 +363,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP
TCHAR buff_proto[128];
ListView_GetItemText(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS), sel, 0, buff_proto, SIZEOF(buff_proto));
TCHAR buff[512];
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_ASK_REMOVEKEY), buff_proto);
+ mir_sntprintf(buff, TranslateT(LANG_OTR_ASK_REMOVEKEY), buff_proto);
if (IDYES == MessageBox(hwndDlg, buff, TranslateT(LANG_OTR_INFO), MB_ICONQUESTION | MB_YESNO)) {
char *proto = GetProtoName(lv, sel);
if (proto == NULL)
diff --git a/plugins/MirOTR/src/otr.cpp b/plugins/MirOTR/src/otr.cpp
index 2bccd99338..cda80811eb 100644
--- a/plugins/MirOTR/src/otr.cpp
+++ b/plugins/MirOTR/src/otr.cpp
@@ -58,7 +58,7 @@ INT_PTR CALLBACK GenKeyDlgBoxProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM
SetClassLongPtr(hWndDlg, GCLP_HICON, (LONG_PTR)LoadIcon(ICON_OTR, 1));
TCHAR buff[256];
TCHAR *proto = mir_a2t((char*)lParam);
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_GENERATE_KEY), proto);
+ mir_sntprintf(buff, TranslateT(LANG_GENERATE_KEY), proto);
mir_free(proto);
SetDlgItemText(hWndDlg, IDC_GENERATE, buff);
GenKeyData *data = (GenKeyData *)mir_calloc(sizeof(GenKeyData));
@@ -170,14 +170,14 @@ extern "C" {
SetEncryptionStatus(hContact, trusted);
TCHAR buff[512];
if (trusted == TRUST_PRIVATE) {
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_START_OTR), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_SESSION_START_OTR), contact_get_nameT(hContact));
}
else if (trusted == TRUST_UNVERIFIED) {
if (options.autoshow_verify) SMPInitDialog(context); //VerifyContextDialog(context);
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_START_OTR_VERIFY), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_SESSION_START_OTR_VERIFY), contact_get_nameT(hContact));
}
else { // should never happen
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact));
}
if (context->protocol_version < MIROTR_PROTO_LATEST){
size_t remaining = mir_tstrlen(buff);
@@ -194,7 +194,7 @@ extern "C" {
MCONTACT hContact = (MCONTACT)opdata;
DEBUGOUT_T("OTR_GUI_GONE_INSECURE\n");
TCHAR buff[512];
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(hContact));
//MessageBox(0, buff, Translate("OTR Information"), MB_OK);
if (!Miranda_Terminated()) {
ShowMessage(hContact, buff);
@@ -214,27 +214,27 @@ extern "C" {
TCHAR buff[1024];
if (!is_reply) {
if (trusted == TRUST_PRIVATE) {
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_CONTINUE_OTR), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_SESSION_CONTINUE_OTR), contact_get_nameT(hContact));
}
else if (trusted == TRUST_UNVERIFIED) {
if (options.autoshow_verify) SMPInitDialog(context); //VerifyContextDialog(context);
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_SESSION_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact));
}
else { // should never happen
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact));
}
// opdata is hContact
ShowMessage(hContact, buff);
}
else {
if (trusted == TRUST_PRIVATE) {
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_HAS_CONTINUE_OTR), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_SESSION_HAS_CONTINUE_OTR), contact_get_nameT(hContact));
}
else if (trusted == TRUST_UNVERIFIED) {
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_HAS_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_SESSION_HAS_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact));
}
else { // should never happen
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact));
}
}
diff --git a/plugins/MirOTR/src/svcs_menu.cpp b/plugins/MirOTR/src/svcs_menu.cpp
index 86a8e44a37..caf9fed357 100644
--- a/plugins/MirOTR/src/svcs_menu.cpp
+++ b/plugins/MirOTR/src/svcs_menu.cpp
@@ -57,12 +57,12 @@ INT_PTR SVC_StartOTR(WPARAM hContact, LPARAM lParam)
hContact = hSub;
if ( options.bHaveSecureIM && CallService("SecureIM/IsContactSecured", hContact, 0) != 0 ) {
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_SECUREIM_STARTED), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_OTR_SECUREIM_STARTED), contact_get_nameT(hContact));
ShowError(buff);
return 0;
}
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_REQUEST_OTR), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_SESSION_REQUEST_OTR), contact_get_nameT(hContact));
ShowMessage(hContact, buff);
return StartOTR(hContact);
@@ -82,7 +82,7 @@ INT_PTR SVC_RefreshOTR(WPARAM hContact, LPARAM lParam)
return 0;
}
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_TRY_CONTINUE_OTR), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_SESSION_TRY_CONTINUE_OTR), contact_get_nameT(hContact));
ShowMessage(hContact, buff);
int res = StartOTR(hContact);
@@ -116,7 +116,7 @@ INT_PTR SVC_StopOTR(WPARAM hContact, LPARAM lParam)
SetEncryptionStatus(hContact, TRUST_NOT_PRIVATE);
TCHAR buff[512];
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_TERMINATED_OTR), contact_get_nameT(hContact));
+ mir_sntprintf(buff, TranslateT(LANG_SESSION_TERMINATED_OTR), contact_get_nameT(hContact));
ShowMessage(hContact, buff);
return 0;
}
diff --git a/plugins/MirOTR/src/svcs_proto.cpp b/plugins/MirOTR/src/svcs_proto.cpp
index 637497350a..81a78e3005 100644
--- a/plugins/MirOTR/src/svcs_proto.cpp
+++ b/plugins/MirOTR/src/svcs_proto.cpp
@@ -112,7 +112,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam)
if (tlv && !Miranda_Terminated()) {
/* Notify the user that the other side disconnected. */
TCHAR buff[256];
- mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(ccs->hContact));
+ mir_sntprintf(buff, TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(ccs->hContact));
SetEncryptionStatus(ccs->hContact, otr_context_get_trust(context)); // required since libotr 4!?
ShowMessage(ccs->hContact, buff);
}
diff --git a/plugins/MirOTR/src/utils.cpp b/plugins/MirOTR/src/utils.cpp
index 5414ab4568..7dbfc0a293 100644
--- a/plugins/MirOTR/src/utils.cpp
+++ b/plugins/MirOTR/src/utils.cpp
@@ -315,7 +315,7 @@ void ShowErrorUtf(char* msg) {
void ShowMessageInline(const MCONTACT hContact, const TCHAR *msg) {
TCHAR buff[1024];
- mir_sntprintf(buff, SIZEOF(buff), _T("%s%s"), _T(LANG_INLINE_PREFIX), msg);
+ mir_sntprintf(buff, _T("%s%s"), _T(LANG_INLINE_PREFIX), msg);
T2Utf utf(buff);
PROTORECVEVENT pre = {0};