aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-05-05 08:28:29 +0000
committerAndreas Schneider <mail@cynapses.org>2009-05-05 08:28:29 +0000
commitde138cd055228a20b84bba4560273a03ed0d6426 (patch)
tree9c58e4cde3c4b2528e86b5fa9c8f03780e8f85f9 /libssh
parent65331f470a6f260999408a90e174eb718fe10e94 (diff)
downloadlibssh-de138cd055228a20b84bba4560273a03ed0d6426.tar.gz
libssh-de138cd055228a20b84bba4560273a03ed0d6426.tar.xz
libssh-de138cd055228a20b84bba4560273a03ed0d6426.zip
Improve channel_change_pty_size1().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@732 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh')
-rw-r--r--libssh/channels1.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/libssh/channels1.c b/libssh/channels1.c
index d283c6d..b749be4 100644
--- a/libssh/channels1.c
+++ b/libssh/channels1.c
@@ -129,21 +129,13 @@ int channel_request_pty_size1(CHANNEL *channel, const char *terminal, int col,
}
int channel_change_pty_size1(CHANNEL *channel, int cols, int rows) {
- SSH_SESSION *session=channel->session;
+ SSH_SESSION *session = channel->session;
- if (buffer_add_u8(session->out_buffer, SSH_CMSG_WINDOW_SIZE) < 0) {
- return -1;
- }
- if (buffer_add_u32(session->out_buffer, ntohl(rows)) < 0) {
- return -1;
- }
- if (buffer_add_u32(session->out_buffer, ntohl(cols)) < 0) {
- return -1;
- }
- if (buffer_add_u32(session->out_buffer, 0) < 0) {
- return -1;
- }
- if (buffer_add_u32(session->out_buffer, 0) < 0) {
+ if (buffer_add_u8(session->out_buffer, SSH_CMSG_WINDOW_SIZE) < 0 ||
+ buffer_add_u32(session->out_buffer, ntohl(rows)) < 0 ||
+ buffer_add_u32(session->out_buffer, ntohl(cols)) < 0 ||
+ buffer_add_u32(session->out_buffer, 0) < 0 ||
+ buffer_add_u32(session->out_buffer, 0) < 0) {
return -1;
}