summaryrefslogtreecommitdiff
path: root/main.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-17 16:46:24 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-17 16:46:24 -0400
commitde39574e89cc72aef157d10d451fac1f78af37c6 (patch)
tree4debe51b2109378702e02d16bf81186474f549aa /main.cc
parentbbcb49fed27ea7d2052724fbee79f42c9bc744bc (diff)
downloadfork-ledger-de39574e89cc72aef157d10d451fac1f78af37c6.tar.gz
fork-ledger-de39574e89cc72aef157d10d451fac1f78af37c6.tar.bz2
fork-ledger-de39574e89cc72aef157d10d451fac1f78af37c6.zip
fixed a memory corruption bug stemming from not using an input iterator
Diffstat (limited to 'main.cc')
-rw-r--r--main.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/main.cc b/main.cc
index 756fe8b4..bf82d12a 100644
--- a/main.cc
+++ b/main.cc
@@ -14,6 +14,7 @@ using namespace ledger;
#include <fstream>
#include <memory>
#include <algorithm>
+#include <iterator>
#include <string>
#include <cstdlib>
#include <cstring>
@@ -127,11 +128,9 @@ int main(int argc, char * argv[], char * envp[])
journal->sources.pop_front(); // remove cache_file
strings_list exceptions;
-#if 0
std::set_difference(journal->sources.begin(), journal->sources.end(),
config->files.begin(), config->files.end(),
- exceptions.begin());
-#endif
+ std::back_insert_iterator<strings_list>(exceptions));
if (entry_count == 0 || exceptions.size() > 0) {
journal.reset(new journal_t);