From ca942b88c295830544e03804666229e0e955f64b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 31 Aug 2016 12:19:31 +0000 Subject: - memory leak fixed; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@17226 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/BasicHistory/src/BinaryExport.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/BasicHistory/src/BinaryExport.cpp') 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& 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& 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& eventList exMsg.timestamp = messageHeader.timestamp; if (!ReadString(exMsg.message)) return false; - + eventList.push_back(exMsg); } -- cgit v1.2.3