From 07bff43c1ee8ffb1e19dc2ed6419f602c0053f56 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Thu, 12 Aug 2010 21:19:08 +0300 Subject: modified: gpg_wrapper.cpp modified: gpg_wrapper.h modified: main.cpp modified: messages.cpp modified: options.cpp --- options.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'options.cpp') diff --git a/options.cpp b/options.cpp index 4f2dbce..906119a 100644 --- a/options.cpp +++ b/options.cpp @@ -139,7 +139,6 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA return TRUE; case IDC_DELETE_KEY_BUTTON: { //gpg execute block - TCHAR cmd[40960] = {0}; TCHAR tmp2[MAX_PATH] = {0}; TCHAR *ptmp; char *tmp; @@ -161,15 +160,14 @@ static BOOL CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA } if(!keep) { + wstring cmd; string output; DWORD exitcode; - _tcscat(cmd, _T(" --batch")); - _tcscat(cmd, _T(" --yes")); - _tcscat(cmd, _T(" --delete-key ")); + cmd += _T(" --batch --yes --delete-key "); ptmp = mir_a2t(tmp); - _tcscat(cmd, ptmp); + cmd += ptmp; mir_free(ptmp); - pxExecute(cmd, "", &output,&exitcode); + pxExecute(&cmd, "", &output,&exitcode); MessageBoxA(0, "Key removed from GPG keyring", "info", MB_OK); } mir_free(tmp); @@ -351,12 +349,12 @@ static BOOL CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LP _tcscpy(tmp, key_buf.substr(ws1,ws2-ws1).c_str()); ListView_SetItemText(hwndList_p, item_num, 2, tmp); { //gpg execute block - TCHAR cmd[4096] = {0}; + wstring cmd; TCHAR tmp2[MAX_PATH] = {0}; TCHAR *ptmp; string output; DWORD exitcode; - _tcscat(cmd, _T(" --import ")); + { ptmp = UniGetContactSettingUtf(NULL, szModuleName, "szHomePath", _T("")); _tcscpy(tmp2, ptmp); @@ -374,11 +372,11 @@ static BOOL CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LP } f<