From 538c201686084c9a8d575aec6d87faaeb1ffdf50 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sat, 18 Sep 2010 11:31:08 +0300 Subject: modified: options.cpp --- options.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'options.cpp') diff --git a/options.cpp b/options.cpp index dfbe50f..6266c05 100644 --- a/options.cpp +++ b/options.cpp @@ -1128,9 +1128,16 @@ static BOOL CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LP debuglog<<"info: Failed to read key file\n"; break; } - 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)) + ws2 = key_buf.find(_T("-----END PGP PUBLIC KEY BLOCK-----")); + ws1 = key_buf.find(_T("-----BEGIN PGP PUBLIC KEY BLOCK-----")); + if(ws2 == wstring::npos || ws1 == wstring::npos) { - MessageBox(0, _T("This is not public key"), _T("INFO"), MB_OK); + ws2 = key_buf.find(_T("-----END PGP PRIVATE KEY BLOCK-----")); + ws1 = key_buf.find(_T("-----BEGIN PGP PRIVATE KEY BLOCK-----")); + } + if(ws2 == wstring::npos || ws1 == wstring::npos) + { + MessageBox(0, _T("Where is no public or private key."), _T("Info"), MB_OK); break; } ws2 += _tcslen(_T("-----END PGP PUBLIC KEY BLOCK-----")); -- cgit v1.2.3