summaryrefslogtreecommitdiff
path: root/plugins/New_GPG/src/messages.cpp
diff options
context:
space:
mode:
authorAlexander Gluzsky <sss123next@list.ru>2012-10-16 07:21:28 +0000
committerAlexander Gluzsky <sss123next@list.ru>2012-10-16 07:21:28 +0000
commit5edc875e696a39cdf62d873a664d8a6cb2d26ad9 (patch)
treef641027a0885ece0fca30b22240bc1438304182a /plugins/New_GPG/src/messages.cpp
parentf49964c318fbf1e41622204e640ba71bf896db0d (diff)
fixed trash in files for encryption
git-svn-id: http://svn.miranda-ng.org/main/trunk@1954 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG/src/messages.cpp')
-rwxr-xr-xplugins/New_GPG/src/messages.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp
index bab5fb051e..7eb598cc16 100755
--- a/plugins/New_GPG/src/messages.cpp
+++ b/plugins/New_GPG/src/messages.cpp
@@ -668,8 +668,8 @@ void SendMsgSvc_func(HANDLE hContact, char *msg, DWORD flags)
if(!tmp[0])
{
mir_free(tmp);
- HistoryLog(hContact, db_event("Failed to encrypt message with GPG", 0,0, DBEF_SENT));
- hcontact_data[hContact].msgs_to_pass.push_back("Failed to encrypt message with GPG");
+ HistoryLog(hContact, db_event("Failed to encrypt message with GPG (not found key for encryption in db)", 0,0, DBEF_SENT));
+ hcontact_data[hContact].msgs_to_pass.push_back("Failed to encrypt message with GPG (not found key for encryption in db)");
mir_free(msg);
CallContactService(hContact, PSS_MESSAGE, (WPARAM)flags, (LPARAM)msg);
return;
@@ -694,13 +694,11 @@ void SendMsgSvc_func(HANDLE hContact, char *msg, DWORD flags)
path += file;
cmd += _T("\"");
{
- char *tmp;
- tmp = mir_strdup(toUTF8(str).c_str());
fstream f(path.c_str(), std::ios::out);
while(!f.is_open())
f.open(path.c_str(), std::ios::out);
- f<<tmp;
- mir_free(tmp);
+ std::string tmp = toUTF8(str);
+ f.write(tmp.c_str(), tmp.size());
f.close();
}
gpg_execution_params params;