From 60860bc3697233687834d4efd4f1fe616f2fb9fb Mon Sep 17 00:00:00 2001 From: jacob Date: Sat, 31 May 2008 17:22:29 +0000 Subject: [PATCH] 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). git-svn-id: svn://svn.tartarus.org/sgt/putty@8030 cda61777-01e9-0310-a592-d414129be87e --- ssh.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ssh.c b/ssh.c index eec05808..f22a2b61 100644 --- a/ssh.c +++ b/ssh.c @@ -8569,7 +8569,7 @@ static void ssh2_msg_disconnect(Ssh ssh, struct Packet *pktin) { /* log reason code in disconnect message */ char *buf, *msg; - int nowlen, reason, msglen; + int reason, msglen; reason = ssh_pkt_getuint32(pktin); ssh_pkt_getstring(pktin, &msg, &msglen); @@ -8583,14 +8583,14 @@ static void ssh2_msg_disconnect(Ssh ssh, struct Packet *pktin) } logevent(buf); sfree(buf); - buf = dupprintf("Disconnection message text: %n%.*s", - &nowlen, msglen, msg); + buf = dupprintf("Disconnection message text: %.*s", + msglen, msg); logevent(buf); - bombout(("Server sent disconnect message\ntype %d (%s):\n\"%s\"", + bombout(("Server sent disconnect message\ntype %d (%s):\n\"%.*s\"", reason, (reason > 0 && reason < lenof(ssh2_disconnect_reasons)) ? ssh2_disconnect_reasons[reason] : "unknown", - buf+nowlen)); + msglen, msg)); sfree(buf); } -- 2.11.0