From c09aa99a7e9915c503064d6eb5e9dd1bdd2a673f Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Fri, 22 May 2015 20:07:58 +0000 Subject: replace _tcscpy to mir_tstrcpy git-svn-id: http://svn.miranda-ng.org/main/trunk@13764 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/New_GPG/src/main.cpp | 8 ++++---- plugins/New_GPG/src/messages.cpp | 4 ++-- plugins/New_GPG/src/options.cpp | 18 +++++++++--------- plugins/New_GPG/src/utilities.cpp | 12 ++++++------ 4 files changed, 21 insertions(+), 21 deletions(-) (limited to 'plugins/New_GPG') diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp index f1436bee2c..e22b320f61 100755 --- a/plugins/New_GPG/src/main.cpp +++ b/plugins/New_GPG/src/main.cpp @@ -296,7 +296,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR { wstring str = name; wstring::size_type p = str.find(_T("("))-1; - _tcscpy(name, str.substr(0, p).c_str()); + mir_tstrcpy(name, str.substr(0, p).c_str()); } } string out; @@ -863,15 +863,15 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, mir_free(mir_path); 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); + mir_tstrcpy(gpg_path, tmp); _tcscat(gpg_path, _T("\\GnuPG\\gpg.exe")); - _tcscpy(gpg_lang_path, tmp); + mir_tstrcpy(gpg_lang_path, tmp); _tcscat(gpg_lang_path, _T("\\GnuPG\\gnupg.nls\\en@quot.mo")); mir_free(tmp); if(boost::filesystem::exists(gpg_path)) { gpg_exists = true; - _tcscpy(path, _T("GnuPG\\gpg.exe")); + mir_tstrcpy(path, _T("GnuPG\\gpg.exe")); } if(boost::filesystem::exists(gpg_lang_path)) lang_exists = true; diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index d13bd66a3b..cc24f0f57a 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -382,7 +382,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l) DWORD exitcode; { ptmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T("")); - _tcscpy(tmp2, ptmp); + mir_tstrcpy(tmp2, ptmp); mir_free(ptmp); _tcscat(tmp2, _T("\\")); TCHAR *tmp3 = mir_a2t(get_random(5).c_str()); @@ -977,7 +977,7 @@ static INT_PTR CALLBACK DlgProcKeyPassword(HWND hwndDlg, UINT msg, WPARAM wParam if(password) mir_free(password); password = (TCHAR*)mir_alloc(sizeof(TCHAR)*(mir_tstrlen(tmp)+1)); - _tcscpy(password, tmp); + mir_tstrcpy(password, tmp); } mir_free(tmp); mir_free(inkeyid); diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp index de5178e515..392aceb8f1 100755 --- a/plugins/New_GPG/src/options.cpp +++ b/plugins/New_GPG/src/options.cpp @@ -639,22 +639,22 @@ static INT_PTR CALLBACK DlgProcGpgMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, db_set_ts(NULL, szGPGModuleName, "szInOpenTag", tmp); mir_free(inopentag); inopentag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (mir_tstrlen(tmp)+1)); - _tcscpy(inopentag, tmp); + mir_tstrcpy(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)* (mir_tstrlen(tmp)+1)); - _tcscpy(inclosetag, tmp); + mir_tstrcpy(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)* (mir_tstrlen(tmp)+1)); - _tcscpy(outopentag, tmp); + mir_tstrcpy(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)*(mir_tstrlen(tmp)+1)); - _tcscpy(outclosetag, tmp); + mir_tstrcpy(outclosetag, tmp); } return TRUE; } @@ -856,16 +856,16 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam 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) * (mir_tstrlen(_T("-----BEGIN PGP PUBLIC KEY BLOCK-----")) + 1)); - _tcscpy(begin, _T("-----BEGIN PGP PUBLIC KEY BLOCK-----")); + mir_tstrcpy(begin, _T("-----BEGIN PGP PUBLIC KEY BLOCK-----")); end = (TCHAR*)mir_alloc(sizeof( TCHAR) * (mir_tstrlen(_T("-----END PGP PUBLIC KEY BLOCK-----")) + 1)); - _tcscpy(end, _T("-----END PGP PUBLIC KEY BLOCK-----")); + mir_tstrcpy(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) * (mir_tstrlen(_T("-----BEGIN PGP PRIVATE KEY BLOCK-----")) + 1)); - _tcscpy(begin, _T("-----BEGIN PGP PRIVATE KEY BLOCK-----")); + mir_tstrcpy(begin, _T("-----BEGIN PGP PRIVATE KEY BLOCK-----")); end = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(_T("-----END PGP PRIVATE KEY BLOCK-----")) + 1)); - _tcscpy(end, _T("-----END PGP PRIVATE KEY BLOCK-----")); + mir_tstrcpy(end, _T("-----END PGP PRIVATE KEY BLOCK-----")); } else { @@ -893,7 +893,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam else db_set_ts(hContact, szGPGModuleName, "GPGPubKey", key_buf.substr(ws1,ws2-ws1).c_str()); } tmp = (TCHAR*)mir_alloc(sizeof( TCHAR) * (key_buf.length()+1)); - _tcscpy(tmp, key_buf.substr(ws1,ws2-ws1).c_str()); + mir_tstrcpy(tmp, key_buf.substr(ws1,ws2-ws1).c_str()); { //gpg execute block std::vector cmd; TCHAR tmp2[MAX_PATH] = {0}; diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index c5ca301b30..ab75f3c284 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -63,7 +63,7 @@ void GetFilePath(TCHAR *WindowTittle, char *szSetting, TCHAR *szExt, TCHAR *szEx ofn.lpstrTitle=TranslateW(WindowTittle); _tcsncpy(filter,TranslateW(szExtDesc), SIZEOF(filter)-1); pfilter=filter+mir_tstrlen(filter)+1; - _tcscpy(pfilter, szExt); + mir_tstrcpy(pfilter, szExt); pfilter[mir_tstrlen(pfilter)+1] = '\0'; pfilter[mir_tstrlen(pfilter)+2] = '\0'; ofn.lpstrFilter=filter; @@ -88,13 +88,13 @@ TCHAR *GetFilePath(TCHAR *WindowTittle, TCHAR *szExt, TCHAR *szExtDesc, bool sav ofn.lStructSize=CDSIZEOF_STRUCT(OPENFILENAME,lpTemplateName); ofn.Flags=OFN_EXPLORER; ofn.lpstrTitle=TranslateW(WindowTittle); - _tcscpy(filter,TranslateW(szExtDesc)); + mir_tstrcpy(filter,TranslateW(szExtDesc)); pfilter=filter+mir_tstrlen(filter)+1; - _tcscpy(pfilter, szExt); + mir_tstrcpy(pfilter, szExt); pfilter[mir_tstrlen(pfilter)+1] = '\0'; pfilter[mir_tstrlen(pfilter)+2] = '\0'; ofn.lpstrFilter=filter; - _tcscpy(str, _T("")); + mir_tstrcpy(str, _T("")); if(mir_tstrlen(str)< 2) str[0] = '\0'; ofn.lpstrFile=str; @@ -1135,7 +1135,7 @@ bool isGPGValid() mir_free(mir_path); //mir_realloc(path, (mir_tstrlen(path)+64)*sizeof(TCHAR)); TCHAR *gpg_path = (TCHAR*)mir_alloc(sizeof(TCHAR)*MAX_PATH); - _tcscpy(gpg_path, tmp); + mir_tstrcpy(gpg_path, tmp); _tcscat(gpg_path, _T("\\GnuPG\\gpg.exe")); mir_free(tmp); tmp = NULL; @@ -1143,7 +1143,7 @@ bool isGPGValid() if(boost::filesystem::exists(p) && boost::filesystem::is_regular_file(p)) { gpg_exists = true; - _tcscpy(path, _T("GnuPG\\gpg.exe")); + mir_tstrcpy(path, _T("GnuPG\\gpg.exe")); } mir_free(gpg_path); tmp = mir_tstrdup(path); -- cgit v1.2.3