summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
Diffstat (limited to 'methods')
-rw-r--r--methods/http.cc4
-rw-r--r--methods/rred.cc2
2 files changed, 3 insertions, 3 deletions
diff --git a/methods/http.cc b/methods/http.cc
index 7b61973d7..ba0241fc1 100644
--- a/methods/http.cc
+++ b/methods/http.cc
@@ -552,7 +552,7 @@ 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,
+ if (sscanf(Line.c_str(),"HTTP/%u.%u %u%[^\n]",&Major,&Minor,
&Result,Code) != 4)
return _error->Error(_("The HTTP server sent an invalid reply header"));
}
@@ -560,7 +560,7 @@ bool ServerState::HeaderLine(string Line)
{
Major = 0;
Minor = 9;
- if (sscanf(Line.c_str(),"HTTP %u %[^\n]",&Result,Code) != 2)
+ if (sscanf(Line.c_str(),"HTTP %u%[^\n]",&Result,Code) != 2)
return _error->Error(_("The HTTP server sent an invalid reply header"));
}
diff --git a/methods/rred.cc b/methods/rred.cc
index 6fa57f3a6..27d95bdde 100644
--- a/methods/rred.cc
+++ b/methods/rred.cc
@@ -174,7 +174,7 @@ int RredMethod::ed_file(FILE *ed_cmds, FILE *in_file, FILE *out_file,
hash);
/* read the rest from infile */
- if (result > 0) {
+ if (result >= 0) {
while (fgets(buffer, BUF_SIZE, in_file) != NULL) {
written = fwrite(buffer, 1, strlen(buffer), out_file);
hash->Add((unsigned char*)buffer, written);