summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
25db03c)
for this change, just tidiness.)
git-svn-id: svn://svn.tartarus.org/sgt/putty@4528
cda61777-01e9-0310-a592-
d414129be87e
}
/* List client->server compression algorithms. */
ssh2_pkt_addstring_start(ssh);
}
/* List client->server compression algorithms. */
ssh2_pkt_addstring_start(ssh);
- for (i = 0; i < lenof(compressions) + 1; i++) {
- const struct ssh_compress *c =
- i == 0 ? s->preferred_comp : compressions[i - 1];
- ssh2_pkt_addstring_str(ssh, c->name);
- if (i < lenof(compressions))
+ assert(lenof(compressions) > 1);
+ ssh2_pkt_addstring_str(ssh, s->preferred_comp->name);
+ for (i = 0; i < lenof(compressions); i++) {
+ const struct ssh_compress *c = compressions[i];
+ if (c != s->preferred_comp) {
ssh2_pkt_addstring_str(ssh, ",");
ssh2_pkt_addstring_str(ssh, ",");
+ ssh2_pkt_addstring_str(ssh, c->name);
+ }
}
/* List server->client compression algorithms. */
ssh2_pkt_addstring_start(ssh);
}
/* List server->client compression algorithms. */
ssh2_pkt_addstring_start(ssh);
- for (i = 0; i < lenof(compressions) + 1; i++) {
- const struct ssh_compress *c =
- i == 0 ? s->preferred_comp : compressions[i - 1];
- ssh2_pkt_addstring_str(ssh, c->name);
- if (i < lenof(compressions))
+ assert(lenof(compressions) > 1);
+ ssh2_pkt_addstring_str(ssh, s->preferred_comp->name);
+ for (i = 0; i < lenof(compressions); i++) {
+ const struct ssh_compress *c = compressions[i];
+ if (c != s->preferred_comp) {
ssh2_pkt_addstring_str(ssh, ",");
ssh2_pkt_addstring_str(ssh, ",");
+ ssh2_pkt_addstring_str(ssh, c->name);
+ }
}
/* List client->server languages. Empty list. */
ssh2_pkt_addstring_start(ssh);
}
/* List client->server languages. Empty list. */
ssh2_pkt_addstring_start(ssh);