diff options
Diffstat (limited to 'methods')
-rw-r--r-- | methods/bzip2.cc | 3 | ||||
-rw-r--r-- | methods/gpgv.cc | 2 | ||||
-rw-r--r-- | methods/http.cc | 10 |
3 files changed, 10 insertions, 5 deletions
diff --git a/methods/bzip2.cc b/methods/bzip2.cc index 19e49828e..241f21c66 100644 --- a/methods/bzip2.cc +++ b/methods/bzip2.cc @@ -102,9 +102,8 @@ bool Bzip2Method::Fetch(FetchItem *Itm) while (1) { unsigned char Buffer[4*1024]; - unsigned long Count; - Count = read(GzOut[0],Buffer,sizeof(Buffer)); + ssize_t Count = read(GzOut[0],Buffer,sizeof(Buffer)); if (Count < 0 && errno == EINTR) continue; diff --git a/methods/gpgv.cc b/methods/gpgv.cc index 018e4f622..efe1f73f7 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -69,7 +69,7 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, { // TRANSLATOR: %s is the trusted keyring parts directory ioprintf(ret, _("No keyring installed in %s."), - _config->FindDir("Dir::Etc::TrustedParts", "/etc/apt/trusted.gpg.d").c_str()); + _config->FindDir("Dir::Etc::TrustedParts").c_str()); return ret.str(); } exit(111); diff --git a/methods/http.cc b/methods/http.cc index 9fa74bffa..25e31de9a 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -553,8 +553,14 @@ bool ServerState::HeaderLine(string Line) // Evil servers return no version if (Line[4] == '/') { - if (sscanf(Line.c_str(),"HTTP/%u.%u %u%[^\n]",&Major,&Minor, - &Result,Code) != 4) + int const elements = sscanf(Line.c_str(),"HTTP/%u.%u %u%[^\n]",&Major,&Minor,&Result,Code); + if (elements == 3) + { + Code[0] = '\0'; + if (Debug == true) + clog << "HTTP server doesn't give Reason-Phrase for " << Result << std::endl; + } + else if (elements != 4) return _error->Error(_("The HTTP server sent an invalid reply header")); } else |