Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
Fix plurality in unknown host keys log message.
Browse files Browse the repository at this point in the history
  • Loading branch information
jtn20 committed Apr 10, 2016
1 parent e3f5f49 commit 697ea87
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ssh.c
Original file line number Diff line number Diff line change
Expand Up @@ -7309,7 +7309,7 @@ static void do_ssh2_transport(Ssh ssh, const void *vin, int inlen,
* Make a note of any other host key formats that are available.
*/
{
int i, j;
int i, j, nkeys = 0;
char *list = NULL;
for (i = 0; i < lenof(hostkey_algs); i++) {
if (hostkey_algs[i].alg == ssh->hostkey)
Expand All @@ -7328,13 +7328,15 @@ static void do_ssh2_transport(Ssh ssh, const void *vin, int inlen,
newlist = dupprintf("%s", hostkey_algs[i].alg->name);
sfree(list);
list = newlist;
nkeys++;
}
}
if (list) {
logeventf(ssh,
"Server also has %s host key%s, but we "
"don't know %s", list,
j > 1 ? "s" : "", j > 1 ? "any of them" : "it");
nkeys > 1 ? "s" : "",
nkeys > 1 ? "any of them" : "it");
sfree(list);
}
}
Expand Down

0 comments on commit 697ea87

Please sign in to comment.