diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2013-04-08 15:38:45 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2013-04-08 15:38:45 +0200 |
commit | 3278fe66567d149ea92c1afa78941f2bc3c71c85 (patch) | |
tree | 3a735d19278bb8f5aa19ba2707f3a09cf52e1d21 /apt-pkg/srcrecords.cc | |
parent | 37cc828e003f51d63ed991be5acac36765b8230a (diff) | |
parent | 885594fc8831d1be5a254557385e3dbefb564fbf (diff) |
merged bundle from david
Diffstat (limited to 'apt-pkg/srcrecords.cc')
-rw-r--r-- | apt-pkg/srcrecords.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc index d63d2c422..297559957 100644 --- a/apt-pkg/srcrecords.cc +++ b/apt-pkg/srcrecords.cc @@ -42,7 +42,7 @@ pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : d(NULL), Files(0), Current(0 } // Doesn't work without any source index files - if (Files.size() == 0) + if (Files.empty() == true) { _error->Error(_("You must put some 'source' URIs" " in your sources.list")); @@ -121,14 +121,13 @@ pkgSrcRecords::Parser *pkgSrcRecords::Find(const char *Package,bool const &SrcOn /* */ const char *pkgSrcRecords::Parser::BuildDepType(unsigned char const &Type) { - const char *fields[] = {"Build-Depends", - "Build-Depends-Indep", + const char *fields[] = {"Build-Depends", + "Build-Depends-Indep", "Build-Conflicts", "Build-Conflicts-Indep"}; - if (Type < 4) - return fields[Type]; - else + if (unlikely(Type >= sizeof(fields)/sizeof(fields[0]))) return ""; + return fields[Type]; } /*}}}*/ |