Krzysztof Kowalczyk's fix for "Assertion failed: actuallen <= len" when
authorjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Tue, 27 Apr 2004 18:16:33 +0000 (18:16 +0000)
committerjacob <jacob@cda61777-01e9-0310-a592-d414129be87e>
Tue, 27 Apr 2004 18:16:33 +0000 (18:16 +0000)
transferring files >2G with PSCP.
(I'm unable to actually test this works, but it looks plausible, and small
transfers aren't mangled.)

git-svn-id: svn://svn.tartarus.org/sgt/putty@4152 cda61777-01e9-0310-a592-d414129be87e

scp.c

diff --git a/scp.c b/scp.c
index 781e375..4334d9f 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -1833,11 +1833,12 @@ static void sink(char *targ, char *src)
        received = 0;
        while (received < act.size) {
            char transbuf[4096];
-           int blksize, read;
+           unsigned long blksize;
+           int read;
            blksize = 4096;
-           if (blksize > (int)(act.size - received))
+           if (blksize > (act.size - received))
                blksize = act.size - received;
-           read = scp_recv_filedata(transbuf, blksize);
+           read = scp_recv_filedata(transbuf, (int)blksize);
            if (read <= 0)
                bump("Lost connection");
            if (wrerror)