diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2010-05-29 19:02:32 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2010-05-29 19:02:32 +0200 |
commit | 461e4a5e0d30549e5b9758ce816027d92747f00d (patch) | |
tree | e03e862cfdfe73a11abe0c36860af2d94e09a6f3 | |
parent | b3fdb998016beb8bf3d8bedb3ad6218f9050eece (diff) |
* apt-pkg/depcache.cc:
- correct "Dangerous iterator usage." pointed out by cppcheck
-rw-r--r-- | apt-pkg/depcache.cc | 6 | ||||
-rw-r--r-- | debian/changelog | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index afec7ba83..6c73b9cfd 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -806,7 +806,7 @@ void pkgDepCache::Update(OpProgress *Prog) a bit we increase with a kill, but we should do something more clever… */ while(recheck.empty() == false) for (std::set<unsigned long>::const_iterator p = recheck.begin(); - p != recheck.end(); ++p) { + p != recheck.end();) { if (Prog != 0 && Done%20 == 0) Prog->Progress(Done); PkgIterator P = PkgIterator(*Cache, Cache->PkgP + *p); @@ -814,7 +814,7 @@ void pkgDepCache::Update(OpProgress *Prog) ++killed; ++Done; } - recheck.erase(p); + recheck.erase(p++); } /* Okay, we have killed a great amount of pseudopackages - @@ -849,7 +849,7 @@ void pkgDepCache::Update(OpProgress *Prog) unsigned long const G = *g; recheck.erase(g); if (unlikely(ReInstallPseudoForGroup(G, recheck) == false)) - _error->Warning(_("Internal error, group '%s' has no installable pseudo package"), GrpIterator(*Cache, Cache->GrpP + *g).Name()); + _error->Warning(_("Internal error, group '%s' has no installable pseudo package"), GrpIterator(*Cache, Cache->GrpP + G).Name()); } } diff --git a/debian/changelog b/debian/changelog index 839c8c800..e8c1f9596 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,8 +18,10 @@ apt (0.7.26~exp6) UNRELEASED; urgency=low - do not try PDiff if it is not listed in the Meta file * apt-pkg/cacheiterator.h: - let pkgCache::Iterator inherent std::iterator + * apt-pkg/depcache.cc: + - correct "Dangerous iterator usage." pointed out by cppcheck - -- David Kalnischkies <kalnischkies@gmail.com> Sat, 29 May 2010 15:39:07 +0200 + -- David Kalnischkies <kalnischkies@gmail.com> Sat, 29 May 2010 19:02:12 +0200 apt (0.7.26~exp5) experimental; urgency=low |