From d811478071c1ce5e90cc588e62dce8782a779ac0 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 28 Apr 2010 00:39:23 +0200 Subject: [PATCH] sftp_read: move a read_responses array to where its used I find that this increases readability since the array is used only in the function call just immediately below and nowhere else. --- src/sftp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sftp.c b/src/sftp.c index db0615c2..2ed64b7b 100644 --- a/src/sftp.c +++ b/src/sftp.c @@ -1014,8 +1014,6 @@ static ssize_t sftp_read(LIBSSH2_SFTP_HANDLE * handle, char *buffer, offset(8) + length(4) */ ssize_t packet_len = handle->handle_len + 25; unsigned char *packet, *s, *data; - static const unsigned char read_responses[2] = - { SSH_FXP_DATA, SSH_FXP_STATUS }; size_t bytes_read = 0; size_t bytes_requested = 0; size_t total_read = 0; @@ -1100,6 +1098,8 @@ static ssize_t sftp_read(LIBSSH2_SFTP_HANDLE * handle, char *buffer, } if (sftp->read_state == libssh2_NB_state_sent) { + static const unsigned char read_responses[2] = + { SSH_FXP_DATA, SSH_FXP_STATUS }; retcode = sftp_packet_requirev(sftp, 2, read_responses, request_id, &data, &data_len);