aboutsummaryrefslogtreecommitdiff
path: root/libssh/channels1.c
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-05-05 08:30:13 +0000
committerAndreas Schneider <mail@cynapses.org>2009-05-05 08:30:13 +0000
commit8f8e9a2f50dd89abf2a9bdf4234b19843ce03e11 (patch)
tree0d06c4edfdeff4e0958c83dd616268c4d2e6a498 /libssh/channels1.c
parentec714ea67d7eacc01dd5a28b01c95858e9a26769 (diff)
downloadlibssh-8f8e9a2f50dd89abf2a9bdf4234b19843ce03e11.tar.gz
libssh-8f8e9a2f50dd89abf2a9bdf4234b19843ce03e11.tar.xz
libssh-8f8e9a2f50dd89abf2a9bdf4234b19843ce03e11.zip
Improve channel_write1().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@734 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/channels1.c')
-rw-r--r--libssh/channels1.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libssh/channels1.c b/libssh/channels1.c
index 1d36039..44fba82 100644
--- a/libssh/channels1.c
+++ b/libssh/channels1.c
@@ -287,10 +287,8 @@ int channel_write1(CHANNEL *channel, const void *data, int len) {
effectivelen = len > 32000 ? 32000 : len;
- if (buffer_add_u32(session->out_buffer, htonl(effectivelen)) < 0) {
- return -1;
- }
- if (buffer_add_data(session->out_buffer, data, effectivelen) < 0) {
+ if (buffer_add_u32(session->out_buffer, htonl(effectivelen)) < 0 ||
+ buffer_add_data(session->out_buffer, data, effectivelen) < 0) {
return -1;
}