summaryrefslogtreecommitdiff
path: root/options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'options.cpp')
-rw-r--r--options.cpp11
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-----"));