aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2011-02-08 10:59:50 +0100
committerAndreas Schneider <asn@cryptomilk.org>2011-02-08 10:59:50 +0100
commit8078d4f674f311e31af68e8d87f6ba2755f13ece (patch)
treebcde2864515b416a6b8e6409f0b39e18cad419a8
parentac785e0aa3e2700cf8955031866e022010ca8201 (diff)
downloadlibssh-8078d4f674f311e31af68e8d87f6ba2755f13ece.tar.gz
libssh-8078d4f674f311e31af68e8d87f6ba2755f13ece.tar.xz
libssh-8078d4f674f311e31af68e8d87f6ba2755f13ece.zip
doc: Use fwrite for the command example.
-rw-r--r--doc/command.dox4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/command.dox b/doc/command.dox
index 92e256ab..76113543 100644
--- a/doc/command.dox
+++ b/doc/command.dox
@@ -61,7 +61,7 @@ If an error has been encountered, it returns a negative value:
nbytes = ssh_channel_read(channel, buffer, sizeof(buffer), 0);
while (nbytes > 0)
{
- if (write(1, buffer, nbytes) != nbytes)
+ if (fwrite(buffer, 1, nbytes, stdout) != nbytes)
{
ssh_channel_close(channel);
ssh_channel_free(channel);
@@ -69,7 +69,7 @@ If an error has been encountered, it returns a negative value:
}
nbytes = ssh_channel_read(channel, buffer, sizeof(buffer), 0);
}
-
+
if (nbytes < 0)
{
ssh_channel_close(channel);