Due to the return variable 'ret' being shadowed in the transfer loop, errors
in the transfer loop did not affect the final return value of sftp_get_file.
This particularly affects psftp's batch mode (without passing the -be
command-line argument), which would errorneously continue. The solution is
to simply remove the shadowing declaration.
xfer = xfer_download_init(fh, offset);
while (!xfer_done(xfer)) {
void *vbuf;
- int ret, len;
+ int len;
int wpos, wlen;
xfer_download_queue(xfer);