diff options
author | Gluzskiy Alexandr <sss123next@list.ru> | 2010-09-18 11:31:08 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss123next@list.ru> | 2010-09-18 11:31:08 +0300 |
commit | 538c201686084c9a8d575aec6d87faaeb1ffdf50 (patch) | |
tree | 6fd3c4bcdd906070f44f9c9301bb80913cd703be | |
parent | f130a01e7db1ea976665612ebb4ec8cf8e12d9f0 (diff) |
modified: options.cpp
-rw-r--r-- | options.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
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-----")); |