X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/6d7122b5356c0b4d8f51aafdfc1c232392fca695..769e9f3ea1cbe67d3b98e6db6c956abde2384868:/apt-private/private-list.cc?ds=sidebyside diff --git a/apt-private/private-list.cc b/apt-private/private-list.cc index c4d5e8bc3..32c8eeaa2 100644 --- a/apt-private/private-list.cc +++ b/apt-private/private-list.cc @@ -41,7 +41,7 @@ struct PackageSortAlphabetic /*{{{*/ class PackageNameMatcher : public Matcher { public: - PackageNameMatcher(const char **patterns) + explicit PackageNameMatcher(const char **patterns) { for(int i=0; patterns[i] != NULL; ++i) { @@ -93,8 +93,8 @@ static void ListAllVersions(pkgCacheFile &CacheFile, pkgRecords &records,/*{{{*/ bool DoList(CommandLine &Cmd) { pkgCacheFile CacheFile; - pkgCache *Cache = CacheFile.GetPkgCache(); - if (unlikely(Cache == NULL)) + pkgCache * const Cache = CacheFile.GetPkgCache(); + if (unlikely(Cache == nullptr || CacheFile.GetDepCache() == nullptr)) return false; pkgRecords records(CacheFile);