1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-22 14:39:24 -05:00

Apparently Vista's printf-like functions don't support %n by default.

We could explicitly re-enable %n, but we only use it in one place, so take
the path of least resistance and remove that single instance. This stops
dupvprintf() getting stuck in a loop (a behaviour that's caused by a workaround
for a broken libc).

<http://msdn.microsoft.com/en-us/library/ms175782(VS.80).aspx>

[originally from svn r8030]
This commit is contained in:
Jacob Nevins 2008-05-31 17:22:29 +00:00
parent 44f578e479
commit 33bfb2bc72

10
ssh.c
View File

@ -8569,7 +8569,7 @@ static void ssh2_msg_disconnect(Ssh ssh, struct Packet *pktin)
{ {
/* log reason code in disconnect message */ /* log reason code in disconnect message */
char *buf, *msg; char *buf, *msg;
int nowlen, reason, msglen; int reason, msglen;
reason = ssh_pkt_getuint32(pktin); reason = ssh_pkt_getuint32(pktin);
ssh_pkt_getstring(pktin, &msg, &msglen); ssh_pkt_getstring(pktin, &msg, &msglen);
@ -8583,14 +8583,14 @@ static void ssh2_msg_disconnect(Ssh ssh, struct Packet *pktin)
} }
logevent(buf); logevent(buf);
sfree(buf); sfree(buf);
buf = dupprintf("Disconnection message text: %n%.*s", buf = dupprintf("Disconnection message text: %.*s",
&nowlen, msglen, msg); msglen, msg);
logevent(buf); logevent(buf);
bombout(("Server sent disconnect message\ntype %d (%s):\n\"%s\"", bombout(("Server sent disconnect message\ntype %d (%s):\n\"%.*s\"",
reason, reason,
(reason > 0 && reason < lenof(ssh2_disconnect_reasons)) ? (reason > 0 && reason < lenof(ssh2_disconnect_reasons)) ?
ssh2_disconnect_reasons[reason] : "unknown", ssh2_disconnect_reasons[reason] : "unknown",
buf+nowlen)); msglen, msg));
sfree(buf); sfree(buf);
} }