1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 09:27:59 +00:00

log_proxy_stderr: cope with CRLF on proxy stderr lines.

The CR was getting as far as GTK, where it caused a formatting oddity
in the Event Log list box. It should be stripped along with the LF.
This commit is contained in:
Simon Tatham 2018-10-07 14:46:21 +01:00
parent 9072bab11b
commit 55860cace7

View File

@ -91,6 +91,8 @@ void log_proxy_stderr(Plug *plug, bufchain *buf, const void *vdata, int len)
msg = snewn(msglen+1, char);
bufchain_fetch(buf, msg, msglen);
bufchain_consume(buf, msglen);
while (msglen > 0 && (msg[msglen-1] == '\n' || msg[msglen-1] == '\r'))
msglen--;
msg[msglen] = '\0';
fullmsg = dupprintf("proxy: %s", msg);
plug_log(plug, 2, NULL, 0, fullmsg, 0);