aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2010-03-29 22:46:03 +0200
committerAndreas Schneider <mail@cynapses.org>2010-03-29 22:46:03 +0200
commit6e82193175243d7c41ac4bf5ea6b49a2f90187e5 (patch)
tree23de9053cdd6724266e3d87310eb3652e9302506 /examples
parent32ac1e04ec0a05f88cf257456dfcdd1515544283 (diff)
downloadlibssh-6e82193175243d7c41ac4bf5ea6b49a2f90187e5.tar.gz
libssh-6e82193175243d7c41ac4bf5ea6b49a2f90187e5.tar.xz
libssh-6e82193175243d7c41ac4bf5ea6b49a2f90187e5.zip
Fixed build warnings of the scp example.
Diffstat (limited to 'examples')
-rw-r--r--examples/scp_download.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/scp_download.c b/examples/scp_download.c
index 52587b5..b178757 100644
--- a/examples/scp_download.c
+++ b/examples/scp_download.c
@@ -72,7 +72,10 @@ static void create_files(ssh_session session){
}
while(!channel_is_eof(channel)){
channel_read(channel,buffer,1,1);
- write(1,buffer,1);
+ if (write(1,buffer,1) < 0) {
+ fprintf(stderr, "Error writing to buffer\n");
+ return;
+ }
}
channel_close(channel);
channel_free(channel);