summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
Diffstat (limited to 'methods')
-rw-r--r--methods/ftp.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/methods/ftp.cc b/methods/ftp.cc
index 09fbaeb7f..145858f1f 100644
--- a/methods/ftp.cc
+++ b/methods/ftp.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: ftp.cc,v 1.5 1999/03/15 19:51:27 jgg Exp $
+// $Id: ftp.cc,v 1.6 1999/04/11 21:23:10 jgg Exp $
/* ######################################################################
HTTP Aquire Method - This is the FTP aquire method for APT.
@@ -286,6 +286,9 @@ bool FTPConn::Login()
/* This performs a very simple buffered read. */
bool FTPConn::ReadLine(string &Text)
{
+ if (ServerFd == -1)
+ return false;
+
// Suck in a line
while (Len < sizeof(Buffer))
{
@@ -315,7 +318,7 @@ bool FTPConn::ReadLine(string &Text)
}
// Suck it back
- int Res = read(ServerFd,Buffer,sizeof(Buffer) - Len);
+ int Res = read(ServerFd,Buffer + Len,sizeof(Buffer) - Len);
if (Res <= 0)
{
Close();