summaryrefslogtreecommitdiff
path: root/sftp-client.c
diff options
context:
space:
mode:
Diffstat (limited to 'sftp-client.c')
-rw-r--r--sftp-client.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sftp-client.c b/sftp-client.c
index 4f2a1e280..ca5a48597 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -29,7 +29,7 @@
29/* XXX: copy between two remote sites */ 29/* XXX: copy between two remote sites */
30 30
31#include "includes.h" 31#include "includes.h"
32RCSID("$OpenBSD: sftp-client.c,v 1.18 2001/07/14 15:10:16 stevesk Exp $"); 32RCSID("$OpenBSD: sftp-client.c,v 1.19 2001/12/19 07:18:56 deraadt Exp $");
33 33
34#include "buffer.h" 34#include "buffer.h"
35#include "bufaux.h" 35#include "bufaux.h"
@@ -308,9 +308,8 @@ do_lsreaddir(int fd_in, int fd_out, char *path, int printflag,
308 *dir = xmalloc(sizeof(**dir)); 308 *dir = xmalloc(sizeof(**dir));
309 (*dir)[0] = NULL; 309 (*dir)[0] = NULL;
310 } 310 }
311
312 311
313 for(;;) { 312 for (;;) {
314 int count; 313 int count;
315 314
316 id = expected_id = msg_id++; 315 id = expected_id = msg_id++;
@@ -356,7 +355,7 @@ do_lsreaddir(int fd_in, int fd_out, char *path, int printflag,
356 if (count == 0) 355 if (count == 0)
357 break; 356 break;
358 debug3("Received %d SSH2_FXP_NAME responses", count); 357 debug3("Received %d SSH2_FXP_NAME responses", count);
359 for(i = 0; i < count; i++) { 358 for (i = 0; i < count; i++) {
360 char *filename, *longname; 359 char *filename, *longname;
361 Attrib *a; 360 Attrib *a;
362 361
@@ -404,8 +403,8 @@ do_readdir(int fd_in, int fd_out, char *path, SFTP_DIRENT ***dir)
404void free_sftp_dirents(SFTP_DIRENT **s) 403void free_sftp_dirents(SFTP_DIRENT **s)
405{ 404{
406 int i; 405 int i;
407 406
408 for(i = 0; s[i]; i++) { 407 for (i = 0; s[i]; i++) {
409 xfree(s[i]->filename); 408 xfree(s[i]->filename);
410 xfree(s[i]->longname); 409 xfree(s[i]->longname);
411 xfree(s[i]); 410 xfree(s[i]);
@@ -726,7 +725,7 @@ do_download(int fd_in, int fd_out, char *remote_path, char *local_path,
726 725
727 /* Read from remote and write to local */ 726 /* Read from remote and write to local */
728 offset = 0; 727 offset = 0;
729 for(;;) { 728 for (;;) {
730 u_int len; 729 u_int len;
731 char *data; 730 char *data;
732 731
@@ -758,7 +757,7 @@ do_download(int fd_in, int fd_out, char *remote_path, char *local_path,
758 else { 757 else {
759 error("Couldn't read from remote " 758 error("Couldn't read from remote "
760 "file \"%s\" : %s", remote_path, 759 "file \"%s\" : %s", remote_path,
761 fx2txt(status)); 760 fx2txt(status));
762 do_close(fd_in, fd_out, handle, handle_len); 761 do_close(fd_in, fd_out, handle, handle_len);
763 goto done; 762 goto done;
764 } 763 }
@@ -868,7 +867,7 @@ do_upload(int fd_in, int fd_out, char *local_path, char *remote_path,
868 867
869 /* Read from local and write to remote */ 868 /* Read from local and write to remote */
870 offset = 0; 869 offset = 0;
871 for(;;) { 870 for (;;) {
872 int len; 871 int len;
873 char data[COPY_SIZE]; 872 char data[COPY_SIZE];
874 873