X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/c48ef8942d87388a67af9e2cad92171aca3be731..53f3fc59f4eb37eea57bbde53fb75f2e15af0378:/apt-pkg/deb/debindexfile.cc diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index 9be2db4c9..c55847305 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -30,6 +30,7 @@ #include #include +#include /*}}}*/ // Sources Index /*{{{*/ @@ -80,7 +81,11 @@ debPackagesIndex::debPackagesIndex(IndexTarget const &Target, bool const Trusted std::string debPackagesIndex::ArchiveInfo(pkgCache::VerIterator const &Ver) const { std::string Res = Target.Description; - Res.erase(Target.Description.rfind(' ')); + { + auto const space = Target.Description.rfind(' '); + if (space != std::string::npos) + Res.erase(space); + } Res += " "; Res += Ver.ParentPkg().Name(); @@ -194,7 +199,7 @@ bool debDebPkgFileIndex::GetContent(std::ostream &content, std::string const &de return _error->Error("Popen failed"); content << "Filename: " << debfile << "\n"; - content << "Size: " << Buf.st_size << "\n"; + content << "Size: " << std::to_string(Buf.st_size) << "\n"; bool first_line_seen = false; char buffer[1024]; do {