diff options
author | George Hazan <george.hazan@gmail.com> | 2016-08-31 12:19:31 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-08-31 12:19:31 +0000 |
commit | ca942b88c295830544e03804666229e0e955f64b (patch) | |
tree | e19134219dae9befdf0b5cb1764873830058d5ad /plugins/BasicHistory/src/BinaryExport.cpp | |
parent | 75a38acd5c2a1e0abd08d3458d36a452dfd0879a (diff) |
- memory leak fixed;
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@17226 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/BasicHistory/src/BinaryExport.cpp')
-rw-r--r-- | plugins/BasicHistory/src/BinaryExport.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/BasicHistory/src/BinaryExport.cpp b/plugins/BasicHistory/src/BinaryExport.cpp index 6164e8062b..619a9de152 100644 --- a/plugins/BasicHistory/src/BinaryExport.cpp +++ b/plugins/BasicHistory/src/BinaryExport.cpp @@ -60,12 +60,12 @@ void BinaryExport::WriteString(const std::wstring &str) }
bool BinaryExport::ReadString(std::wstring &str)
-{
+{
std::string buf;
int size = 1024;
int pos = 0;
- int totalSize = 0;
- while(true) {
+ int totalSize = 0;
+ while (true) {
buf.resize(size);
if (IMP_FILE.peek() == 0) {
IMP_FILE.get();
@@ -187,7 +187,7 @@ int BinaryExport::IsContactInFile(const std::vector<MCONTACT>& contacts) size_t pos = IMP_FILE.tellg();
if (header.dataStart < pos)
return -2;
-
+
IMP_FILE.seekg(0, std::ios_base::beg);
for (int i = 0; i < (int)contacts.size(); ++i) {
std::wstring pn = GetProtocolName(contacts[i]);
@@ -208,7 +208,7 @@ bool BinaryExport::GetEventList(std::vector<IImport::ExternalMessage>& eventList codepage = header.codepage;
IMP_FILE.seekg(header.dataStart, std::ios_base::beg);
BinaryFileMessageHeader messageHeader;
- while(true) {
+ while (true) {
IMP_FILE.read((char*)&messageHeader, sizeof(BinaryFileMessageHeader));
if (IMP_FILE.eof())
break;
@@ -221,7 +221,7 @@ bool BinaryExport::GetEventList(std::vector<IImport::ExternalMessage>& eventList exMsg.timestamp = messageHeader.timestamp;
if (!ReadString(exMsg.message))
return false;
-
+
eventList.push_back(exMsg);
}
|