]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Krzysztof Kowalczyk's fix for "Assertion failed: actuallen <= len" when
authorJacob Nevins <jacobn@chiark.greenend.org.uk>
Tue, 27 Apr 2004 18:16:33 +0000 (18:16 +0000)
committerJacob Nevins <jacobn@chiark.greenend.org.uk>
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.)

[originally from svn r4152]

scp.c

diff --git a/scp.c b/scp.c
index 781e37582b4ca9a5bb35de68abe20af94dadfd64..4334d9fff65d5607abd6f66a0b1016cfbeecd148 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)