1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-02-04 14:12:24 +00:00

Fix plurality in unknown host keys log message.

This commit is contained in:
Jacob Nevins 2016-04-10 15:57:00 +01:00
parent e3f5f49cc4
commit 697ea87808

6
ssh.c
View File

@ -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. * Make a note of any other host key formats that are available.
*/ */
{ {
int i, j; int i, j, nkeys = 0;
char *list = NULL; char *list = NULL;
for (i = 0; i < lenof(hostkey_algs); i++) { for (i = 0; i < lenof(hostkey_algs); i++) {
if (hostkey_algs[i].alg == ssh->hostkey) if (hostkey_algs[i].alg == ssh->hostkey)
@ -7328,13 +7328,15 @@ static void do_ssh2_transport(Ssh ssh, const void *vin, int inlen,
newlist = dupprintf("%s", hostkey_algs[i].alg->name); newlist = dupprintf("%s", hostkey_algs[i].alg->name);
sfree(list); sfree(list);
list = newlist; list = newlist;
nkeys++;
} }
} }
if (list) { if (list) {
logeventf(ssh, logeventf(ssh,
"Server also has %s host key%s, but we " "Server also has %s host key%s, but we "
"don't know %s", list, "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); sfree(list);
} }
} }