summaryrefslogtreecommitdiff
path: root/options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'options.cpp')
-rw-r--r--options.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/options.cpp b/options.cpp
index c615cb8..9c1dce4 100644
--- a/options.cpp
+++ b/options.cpp
@@ -1048,8 +1048,14 @@ static BOOL CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam,LP
tmp[size]= '\0';
key_buf.append(tmp);
delete [] tmp;
+ f.close();
+ }
+ if(key_buf.empty())
+ {
+ key_buf.clear();
+ debuglog<<"info: Failed to read key file\n";
+ break;
}
- f.close();
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))
{
MessageBox(0, _T("This is not public key"), _T("INFO"), MB_OK);