From dfa01d086287abe5eba8811697f2326b8a785fe0 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 6 Jan 2011 10:09:38 +0100 Subject: examples: Use the src mode in scp do_copy function. Found by clang-analyzer http://test.libssh.org/clang-analyzer/ --- examples/libssh_scp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/libssh_scp.c b/examples/libssh_scp.c index 83e60b53..c3dc1d62 100644 --- a/examples/libssh_scp.c +++ b/examples/libssh_scp.c @@ -182,7 +182,7 @@ static int do_copy(struct location *src, struct location *dest, int recursive){ fd=fileno(src->file); fstat(fd,&s); size=s.st_size; - mode=s.st_mode; + mode = s.st_mode & S_IFMT; filename=ssh_basename(src->path); } else { size=0; @@ -207,7 +207,7 @@ static int do_copy(struct location *src, struct location *dest, int recursive){ } if(dest->is_ssh){ - r=ssh_scp_push_file(dest->scp,src->path,size,0644); + r=ssh_scp_push_file(dest->scp,src->path, size, mode); // snprintf(buffer,sizeof(buffer),"C0644 %d %s\n",size,src->path); if(r==SSH_ERROR){ fprintf(stderr,"error: %s\n",ssh_get_error(dest->session)); -- cgit v1.2.3