cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: small patches for ssh (Daniel Stenberg)

From: Tim Bannister <isoma_at_jellybaby.net>
Date: Mon, 26 Dec 2011 17:33:49 +0000

On 26 Dec 2011, at 17:00, Armel Asselin wrote:

> diff --git a/lib/ssh.c b/lib/ssh.c
> index 23ba5f4..daa66e1 100644
> --- a/lib/ssh.c
> +++ b/lib/ssh.c
> @@ -1900,6 +1900,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
> break;
> }
> sshc->readdir_line = new_readdir_line;
> + sshc->readdir_totalLen += 4 + sshc->readdir_len;
>
> sshc->readdir_currLen += snprintf(sshc->readdir_line +
> sshc->readdir_currLen,

If this is the same ‘4’ as on line 1889:
      new_readdir_line = realloc(sshc->readdir_line,
                                 sshc->readdir_totalLen + 4 +
                                 sshc->readdir_len);

then would it make sense to assign this number once and then use the constant for both cases? It's more clear, I think.

-- 
Tim Bannister – isoma_at_jellybaby.net
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-12-26