Fixed Could not write as much data as expected msg

Bug caused by verifying the size of the buffer in the wrong place
This commit is contained in:
Aris Adamantiadis
2009-06-30 22:17:35 +02:00
committed by Andreas Schneider
parent ae3bb42da5
commit 101bf21d41

View File

@@ -1705,8 +1705,8 @@ ssize_t sftp_write(SFTP_FILE *file, const void *buf, size_t count) {
return -1;
}
string_free(datastring);
packetlen=buffer_get_len(buffer);
len = sftp_packet_write(file->sftp, SSH_FXP_WRITE, buffer);
packetlen=buffer_get_len(buffer);
buffer_free(buffer);
if (len < 0) {
return -1;