aboutsummaryrefslogtreecommitdiff
path: root/examples/exec.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2010-03-29 22:38:21 +0200
committerAndreas Schneider <mail@cynapses.org>2010-03-29 22:38:21 +0200
commitd07aef725e05f02e34d89bce8543a975052f4a6d (patch)
tree696fe396c0e2633e9e96e86b5055aaf668f3e1c0 /examples/exec.c
parentb5eb08ad09abe726d5c973f8437ab60b1190b258 (diff)
downloadlibssh-d07aef725e05f02e34d89bce8543a975052f4a6d.tar.gz
libssh-d07aef725e05f02e34d89bce8543a975052f4a6d.tar.xz
libssh-d07aef725e05f02e34d89bce8543a975052f4a6d.zip
Fixed build warnings in the exec example.
Diffstat (limited to 'examples/exec.c')
-rw-r--r--examples/exec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/exec.c b/examples/exec.c
index e2c2cd12..bff49fd0 100644
--- a/examples/exec.c
+++ b/examples/exec.c
@@ -37,7 +37,9 @@ int main(void) {
while ((rc = channel_read(channel, buffer, sizeof(buffer), 0)) > 0) {
- fwrite(buffer, 1, rc, stdout);
+ if (fwrite(buffer, 1, rc, stdout) != (unsigned int) rc) {
+ return 1;
+ }
}
if (rc < 0) {