diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-22 10:18:21 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-22 10:18:21 +0000 |
commit | b499ebc740aa5480be013d40e0d8097066800642 (patch) | |
tree | ed410ee863f4afc0c579599741bf38b4e3ffb706 /plugins/New_GPG | |
parent | 5a17c9299e03bebf46169927abdeee34aaf8e854 (diff) |
replace _tcslen to mir_tstrlen
git-svn-id: http://svn.miranda-ng.org/main/trunk@13748 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG')
-rwxr-xr-x | plugins/New_GPG/src/gpg_wrapper.cpp | 2 | ||||
-rwxr-xr-x | plugins/New_GPG/src/main.cpp | 18 | ||||
-rwxr-xr-x | plugins/New_GPG/src/messages.cpp | 10 | ||||
-rwxr-xr-x | plugins/New_GPG/src/options.cpp | 32 | ||||
-rwxr-xr-x | plugins/New_GPG/src/utilities.cpp | 36 |
5 files changed, 49 insertions, 49 deletions
diff --git a/plugins/New_GPG/src/gpg_wrapper.cpp b/plugins/New_GPG/src/gpg_wrapper.cpp index 57f8d79205..2c9c57fc92 100755 --- a/plugins/New_GPG/src/gpg_wrapper.cpp +++ b/plugins/New_GPG/src/gpg_wrapper.cpp @@ -48,7 +48,7 @@ pxResult pxExecute(std::vector<std::wstring> &aargv, string *aoutput, LPDWORD ae env.push_back(L"LC_ALL=English"); argv.push_back(bin_path); TCHAR *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T("")); - if(_tcslen(home_dir)) //this check are required for first run gpg binary validation + if(mir_tstrlen(home_dir)) //this check are required for first run gpg binary validation { argv.push_back(L"--homedir"); argv.push_back(home_dir); diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp index ed3737b847..7ca182d3d6 100755 --- a/plugins/New_GPG/src/main.cpp +++ b/plugins/New_GPG/src/main.cpp @@ -861,7 +861,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, SetCurrentDirectoryA(mir_path); tmp = mir_a2t(mir_path); mir_free(mir_path); - mir_realloc(path, (_tcslen(path)+128)*sizeof(TCHAR)); + mir_realloc(path, (mir_tstrlen(path)+128)*sizeof(TCHAR)); TCHAR *gpg_path = (TCHAR*)mir_alloc(sizeof(TCHAR) * MAX_PATH), *gpg_lang_path = (TCHAR*)mir_alloc(sizeof(TCHAR) * MAX_PATH); _tcscpy(gpg_path, tmp); _tcscat(gpg_path, _T("\\GnuPG\\gpg.exe")); @@ -1052,8 +1052,8 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, } db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp); GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, SIZEOF(tmp)); - while(tmp[_tcslen(tmp)-1] == '\\') - tmp[_tcslen(tmp)-1] = '\0'; + while(tmp[mir_tstrlen(tmp)-1] == '\\') + tmp[mir_tstrlen(tmp)-1] = '\0'; if(!tmp[0]) { MessageBox(0, TranslateT("Please set keyring's home directory"), TranslateT("Warning"), MB_OK); @@ -1130,8 +1130,8 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, } db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp); GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, SIZEOF(tmp)); - while(tmp[_tcslen(tmp)-1] == '\\') - tmp[_tcslen(tmp)-1] = '\0'; + while(tmp[mir_tstrlen(tmp)-1] == '\\') + tmp[mir_tstrlen(tmp)-1] = '\0'; if(!tmp[0]) { MessageBox(0, TranslateT("Please set keyring's home directory"), TranslateT("Warning"), MB_OK); @@ -1371,7 +1371,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara { //data sanity checks TCHAR *tmp = (TCHAR*)mir_alloc(sizeof(TCHAR)*5); GetDlgItemText(hwndDlg, IDC_KEY_TYPE, tmp, 5); - if(_tcslen(tmp) < 3) + if(mir_tstrlen(tmp) < 3) { mir_free(tmp); tmp = NULL; MessageBox(0, TranslateT("You must set encryption algorithm first"), TranslateT("Error"), MB_OK); @@ -1390,7 +1390,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara } tmp = (TCHAR*)mir_alloc(sizeof(TCHAR)*12); GetDlgItemText(hwndDlg, IDC_KEY_EXPIRE_DATE, tmp, 11); - if(_tcslen(tmp) != 10 && tmp[0] != '0') + if(mir_tstrlen(tmp) != 10 && tmp[0] != '0') { MessageBox(0, TranslateT("Invalid date"), TranslateT("Error"), MB_OK); mir_free(tmp); @@ -1399,7 +1399,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara mir_free(tmp); tmp = (TCHAR*)mir_alloc(sizeof(TCHAR)*128); GetDlgItemText(hwndDlg, IDC_KEY_REAL_NAME, tmp, 127); - if(_tcslen(tmp) < 5) + if(mir_tstrlen(tmp) < 5) { MessageBox(0, TranslateT("Name must contain at least 5 characters"), TranslateT("Error"), MB_OK); mir_free(tmp); @@ -1414,7 +1414,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara mir_free(tmp); tmp = (TCHAR*)mir_alloc(sizeof(TCHAR)*128); GetDlgItemText(hwndDlg, IDC_KEY_EMAIL, tmp, 128); - if((_tcslen(tmp)) < 5 || (!_tcschr(tmp, _T('@'))) || (!_tcschr(tmp, _T('.')))) + if((mir_tstrlen(tmp)) < 5 || (!_tcschr(tmp, _T('@'))) || (!_tcschr(tmp, _T('.')))) { MessageBox(0, TranslateT("Invalid Email"), TranslateT("Error"), MB_OK); mir_free(tmp); diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index b29af2b1d4..ea2b7370f3 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -72,7 +72,7 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD flags debuglog<<std::string(time_str()+": info: received encrypted message from: "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR))); } boost::algorithm::erase_all(str, "\r"); - s2 += _tcslen(_T("-----END PGP MESSAGE-----")); + s2 += mir_tstrlen(_T("-----END PGP MESSAGE-----")); char *tmp = mir_t2a(str.substr(s1,s2-s1).c_str()); TCHAR *tmp2 = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T("")); wstring path = tmp2; @@ -372,7 +372,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) { if(bDebugLog) debuglog<<std::string(time_str()+": info(autoexchange): found pubkey block:"+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ccs->hContact, GCDNF_TCHAR))); - s2 += _tcslen(_T("-----END PGP PUBLIC KEY BLOCK-----")); + s2 += mir_tstrlen(_T("-----END PGP PUBLIC KEY BLOCK-----")); db_set_ts(ccs->hContact, szGPGModuleName, "GPGPubKey", str.substr(s1,s2-s1).c_str()); { //gpg execute block std::vector<wstring> cmd; @@ -499,11 +499,11 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) void ShowNewKeyDialog(); if(((s2 = str.find(_T("-----END PGP PUBLIC KEY BLOCK-----"))) != wstring::npos) && ((s1 = str.find(_T("-----BEGIN PGP PUBLIC KEY BLOCK-----"))) != wstring::npos)) { - s2 += _tcslen(_T("-----END PGP PUBLIC KEY BLOCK-----")); + s2 += mir_tstrlen(_T("-----END PGP PUBLIC KEY BLOCK-----")); } else if(((s2 = str.find(_T("-----BEGIN PGP PRIVATE KEY BLOCK-----"))) != wstring::npos) && ((s1 = str.find(_T("-----END PGP PRIVATE KEY BLOCK-----"))) != wstring::npos)) { - s2 += _tcslen(_T("-----END PGP PRIVATE KEY BLOCK-----")); + s2 += mir_tstrlen(_T("-----END PGP PRIVATE KEY BLOCK-----")); } new_key.append(str.substr(s1,s2-s1)); //new_key_hcnt_mutex.lock(); @@ -976,7 +976,7 @@ static INT_PTR CALLBACK DlgProcKeyPassword(HWND hwndDlg, UINT msg, WPARAM wParam } if(password) mir_free(password); - password = (TCHAR*)mir_alloc(sizeof(TCHAR)*(_tcslen(tmp)+1)); + password = (TCHAR*)mir_alloc(sizeof(TCHAR)*(mir_tstrlen(tmp)+1)); _tcscpy(password, tmp); } mir_free(tmp); diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp index 80b49f59c7..045623b8b0 100755 --- a/plugins/New_GPG/src/options.cpp +++ b/plugins/New_GPG/src/options.cpp @@ -135,7 +135,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP tmp2 = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyID", "");
tmp = mir_a2t(tmp2);
mir_free(tmp2);
- ListView_SetItemText(hwndList, iRow, 1, (_tcslen(tmp) > 1)?tmp:_T("not set"));
+ ListView_SetItemText(hwndList, iRow, 1, (mir_tstrlen(tmp) > 1)?tmp:_T("not set"));
mir_free(tmp);
char *tmp2 = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainName", "");
if(!toUTF16(tmp2).empty())
@@ -143,7 +143,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP else
tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainName", _T(""));
mir_free(tmp2);
- ListView_SetItemText(hwndList, iRow, 2, (_tcslen(tmp) > 1)?tmp:_T("not set"));
+ ListView_SetItemText(hwndList, iRow, 2, (mir_tstrlen(tmp) > 1)?tmp:_T("not set"));
mir_free(tmp);
tmp2 = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainEmail", "");
if(!toUTF16(tmp2).empty())
@@ -151,7 +151,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP else
tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainEmail", _T(""));
mir_free(tmp2);
- ListView_SetItemText(hwndList, iRow, 3, (_tcslen(tmp) > 1)?tmp:_T("not set"));
+ ListView_SetItemText(hwndList, iRow, 3, (mir_tstrlen(tmp) > 1)?tmp:_T("not set"));
mir_free(tmp);
if(db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0))
ListView_SetCheckState(hwndList, iRow, 1);
@@ -166,7 +166,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
}
tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szLogFilePath", _T(""));
- SetDlgItemText(hwndDlg, IDC_LOG_FILE_EDIT, (_tcslen(tmp) > 1)?tmp:_T("c:\\GPGdebug.log"));
+ SetDlgItemText(hwndDlg, IDC_LOG_FILE_EDIT, (mir_tstrlen(tmp) > 1)?tmp:_T("c:\\GPGdebug.log"));
mir_free(tmp);
CheckStateLoadDB(hwndDlg, IDC_DEBUG_LOG, "bDebugLog", 0);
EnableWindow(GetDlgItem(hwndDlg, IDC_JABBER_API), bIsMiranda09);
@@ -571,8 +571,8 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, GetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp, SIZEOF(tmp));
db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, SIZEOF(tmp));
- while(tmp[_tcslen(tmp)-1] == '\\')
- tmp[_tcslen(tmp)-1] = '\0';
+ while(tmp[mir_tstrlen(tmp)-1] == '\\')
+ tmp[mir_tstrlen(tmp)-1] = '\0';
db_set_ts(NULL, szGPGModuleName, "szHomePath", tmp);
return TRUE;
}
@@ -638,22 +638,22 @@ static INT_PTR CALLBACK DlgProcGpgMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, GetDlgItemText(hwndDlg, IDC_IN_OPEN_TAG, tmp, SIZEOF(tmp));
db_set_ts(NULL, szGPGModuleName, "szInOpenTag", tmp);
mir_free(inopentag);
- inopentag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (_tcslen(tmp)+1));
+ inopentag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (mir_tstrlen(tmp)+1));
_tcscpy(inopentag, tmp);
GetDlgItemText(hwndDlg, IDC_IN_CLOSE_TAG, tmp, SIZEOF(tmp));
db_set_ts(NULL, szGPGModuleName, "szInCloseTag", tmp);
mir_free(inclosetag);
- inclosetag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (_tcslen(tmp)+1));
+ inclosetag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (mir_tstrlen(tmp)+1));
_tcscpy(inclosetag, tmp);
GetDlgItemText(hwndDlg, IDC_OUT_OPEN_TAG, tmp, SIZEOF(tmp));
db_set_ts(NULL, szGPGModuleName, "szOutOpenTag", tmp);
mir_free(outopentag);
- outopentag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (_tcslen(tmp)+1));
+ outopentag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (mir_tstrlen(tmp)+1));
_tcscpy(outopentag, tmp);
GetDlgItemText(hwndDlg, IDC_OUT_CLOSE_TAG, tmp, SIZEOF(tmp));
db_set_ts(NULL, szGPGModuleName, "szOutCloseTag", tmp);
mir_free(outclosetag);
- outclosetag = (TCHAR*)mir_alloc(sizeof(TCHAR)*(_tcslen(tmp)+1));
+ outclosetag = (TCHAR*)mir_alloc(sizeof(TCHAR)*(mir_tstrlen(tmp)+1));
_tcscpy(outclosetag, tmp);
}
return TRUE;
@@ -855,16 +855,16 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam ws1 = 0;
if(((ws2 = key_buf.find(_T("-----END PGP PUBLIC KEY BLOCK-----"))) != wstring::npos) && ((ws1 = key_buf.find(_T("-----BEGIN PGP PUBLIC KEY BLOCK-----"))) != wstring::npos))
{
- begin = (TCHAR*)mir_alloc(sizeof(TCHAR) * (_tcslen(_T("-----BEGIN PGP PUBLIC KEY BLOCK-----")) + 1));
+ begin = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(_T("-----BEGIN PGP PUBLIC KEY BLOCK-----")) + 1));
_tcscpy(begin, _T("-----BEGIN PGP PUBLIC KEY BLOCK-----"));
- end = (TCHAR*)mir_alloc(sizeof( TCHAR) * (_tcslen(_T("-----END PGP PUBLIC KEY BLOCK-----")) + 1));
+ end = (TCHAR*)mir_alloc(sizeof( TCHAR) * (mir_tstrlen(_T("-----END PGP PUBLIC KEY BLOCK-----")) + 1));
_tcscpy(end, _T("-----END PGP PUBLIC KEY BLOCK-----"));
}
else if(((ws2 = key_buf.find(_T("-----END PGP PRIVATE KEY BLOCK-----"))) != wstring::npos) && ((ws1 = key_buf.find(_T("-----BEGIN PGP PRIVATE KEY BLOCK-----"))) != wstring::npos))
{
- begin = (TCHAR*)mir_alloc(sizeof(TCHAR) * (_tcslen(_T("-----BEGIN PGP PRIVATE KEY BLOCK-----")) + 1));
+ begin = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(_T("-----BEGIN PGP PRIVATE KEY BLOCK-----")) + 1));
_tcscpy(begin, _T("-----BEGIN PGP PRIVATE KEY BLOCK-----"));
- end = (TCHAR*)mir_alloc(sizeof(TCHAR) * (_tcslen(_T("-----END PGP PRIVATE KEY BLOCK-----")) + 1));
+ end = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(_T("-----END PGP PRIVATE KEY BLOCK-----")) + 1));
_tcscpy(end, _T("-----END PGP PRIVATE KEY BLOCK-----"));
}
else
@@ -872,7 +872,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam MessageBox(0, TranslateT("This is not public or private key"), _T("INFO"), MB_OK);
break;
}
- ws2 += _tcslen(end);
+ ws2 += mir_tstrlen(end);
bool allsubcontacts = false;
{
if(db_mc_isMeta(hContact))
@@ -1252,7 +1252,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam MessageBox(0, TranslateT("There is no public or private key."), TranslateT("Info"), MB_OK);
break;
}
- ws2 += _tcslen(_T("-----END PGP PUBLIC KEY BLOCK-----"));
+ ws2 += mir_tstrlen(_T("-----END PGP PUBLIC KEY BLOCK-----"));
SetDlgItemText(hwndDlg, IDC_PUBLIC_KEY_EDIT, key_buf.substr(ws1,ws2-ws1).c_str());
key_buf.clear();
}
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index 63ece6aab0..76b338c6a3 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -62,15 +62,15 @@ void GetFilePath(TCHAR *WindowTittle, char *szSetting, TCHAR *szExt, TCHAR *szEx ofn.Flags=OFN_EXPLORER; ofn.lpstrTitle=TranslateW(WindowTittle); _tcsncpy(filter,TranslateW(szExtDesc), SIZEOF(filter)-1); - pfilter=filter+_tcslen(filter)+1; + pfilter=filter+mir_tstrlen(filter)+1; _tcscpy(pfilter, szExt); - pfilter[_tcslen(pfilter)+1] = '\0'; - pfilter[_tcslen(pfilter)+2] = '\0'; + pfilter[mir_tstrlen(pfilter)+1] = '\0'; + pfilter[mir_tstrlen(pfilter)+2] = '\0'; ofn.lpstrFilter=filter; tmp = UniGetContactSettingUtf(0, szGPGModuleName, szSetting, _T("")); _tcsncpy(str, tmp, SIZEOF(str)-1); mir_free(tmp); - if(_tcslen(str)< 2) + if(mir_tstrlen(str)< 2) str[0] = '\0'; ofn.lpstrFile=str; ofn.nMaxFile=_MAX_PATH; @@ -89,13 +89,13 @@ TCHAR *GetFilePath(TCHAR *WindowTittle, TCHAR *szExt, TCHAR *szExtDesc, bool sav ofn.Flags=OFN_EXPLORER; ofn.lpstrTitle=TranslateW(WindowTittle); _tcscpy(filter,TranslateW(szExtDesc)); - pfilter=filter+_tcslen(filter)+1; + pfilter=filter+mir_tstrlen(filter)+1; _tcscpy(pfilter, szExt); - pfilter[_tcslen(pfilter)+1] = '\0'; - pfilter[_tcslen(pfilter)+2] = '\0'; + pfilter[mir_tstrlen(pfilter)+1] = '\0'; + pfilter[mir_tstrlen(pfilter)+2] = '\0'; ofn.lpstrFilter=filter; _tcscpy(str, _T("")); - if(_tcslen(str)< 2) + if(mir_tstrlen(str)< 2) str[0] = '\0'; ofn.lpstrFile=str; ofn.nMaxFile=_MAX_PATH; @@ -336,7 +336,7 @@ int onProtoAck(WPARAM w, LPARAM l) cmd.push_back(L"-o"); wstring file = filename; wstring::size_type p1 = file.rfind(_T(".gpg")); - file.erase(p1, _tcslen(_T(".gpg"))); + file.erase(p1, mir_tstrlen(_T(".gpg"))); if(boost::filesystem::exists(file)) { if(MessageBox(0, TranslateT("Target file exists, do you want to replace it?"), TranslateT("Warning"), MB_YESNO) == IDNO) @@ -354,16 +354,16 @@ int onProtoAck(WPARAM w, LPARAM l) dbsetting += keyid; dbsetting += "_Password"; pass = UniGetContactSettingUtf(NULL, szGPGModuleName, dbsetting.c_str(), _T("")); - if(_tcslen(pass) > 0 && bDebugLog) + if(mir_tstrlen(pass) > 0 && bDebugLog) debuglog<<std::string(time_str()+": info: found password in database for key ID: "+keyid+", trying to decrypt message from "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ack->hContact, GCDNF_TCHAR))+" with password"); } else { pass = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", _T("")); - if(_tcslen(pass) > 0 && bDebugLog) + if(mir_tstrlen(pass) > 0 && bDebugLog) debuglog<<std::string(time_str()+": info: found password for all keys in database, trying to decrypt message from "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ack->hContact, GCDNF_TCHAR))+" with password"); } - if(_tcslen(pass) > 0) + if(mir_tstrlen(pass) > 0) { cmd.push_back(L"--passphrase"); cmd.push_back(pass); @@ -483,8 +483,8 @@ std::wstring encrypt_file(MCONTACT hContact, TCHAR *filename) name = filename; else name++; - TCHAR *file_out = new TCHAR [_tcslen(name) + _tcslen(_T(".gpg")) + 1]; - mir_sntprintf(file_out, _tcslen(name) + _tcslen(_T(".gpg")) + 1, _T("%s.gpg"), name); + TCHAR *file_out = new TCHAR [mir_tstrlen(name) + mir_tstrlen(_T(".gpg")) + 1]; + mir_sntprintf(file_out, mir_tstrlen(name) + mir_tstrlen(_T(".gpg")) + 1, _T("%s.gpg"), name); cmd.push_back(szKeyid); if(db_get_b(hcnt, szGPGModuleName, "bAlwaysTrust", 0)) { @@ -723,7 +723,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU { wstring data = str; xi.setText(local_node, _T("This message is encrypted.")); - wstring::size_type p1 = data.find(_T("-----BEGIN PGP MESSAGE-----")) + _tcslen(_T("-----BEGIN PGP MESSAGE-----")); + wstring::size_type p1 = data.find(_T("-----BEGIN PGP MESSAGE-----")) + mir_tstrlen(_T("-----BEGIN PGP MESSAGE-----")); while(data.find(_T("Version: "), p1) != wstring::npos) { p1 = data.find(_T("Version: "), p1); @@ -859,7 +859,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU } if(data.find(_T("-----BEGIN PGP SIGNATURE-----")) != wstring::npos && data.find(_T("-----END PGP SIGNATURE-----")) != wstring::npos) { - wstring::size_type p1 = data.find(_T("-----BEGIN PGP SIGNATURE-----")) + _tcslen(_T("-----BEGIN PGP SIGNATURE-----")); + wstring::size_type p1 = data.find(_T("-----BEGIN PGP SIGNATURE-----")) + mir_tstrlen(_T("-----BEGIN PGP SIGNATURE-----")); if(data.find(_T("Version: "), p1) != wstring::npos) { p1 = data.find(_T("Version: "), p1); @@ -1091,7 +1091,7 @@ bool isContactSecured(MCONTACT hContact) bool isContactHaveKey(MCONTACT hContact) { TCHAR *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", _T("")); - if(_tcslen(key) > 0) + if(mir_tstrlen(key) > 0) { mir_free(key); return true; @@ -1133,7 +1133,7 @@ bool isGPGValid() SetCurrentDirectoryW(mir_path); tmp = mir_tstrdup(mir_path); mir_free(mir_path); - //mir_realloc(path, (_tcslen(path)+64)*sizeof(TCHAR)); + //mir_realloc(path, (mir_tstrlen(path)+64)*sizeof(TCHAR)); TCHAR *gpg_path = (TCHAR*)mir_alloc(sizeof(TCHAR)*MAX_PATH); _tcscpy(gpg_path, tmp); _tcscat(gpg_path, _T("\\GnuPG\\gpg.exe")); |