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

SSH packet logs: don't rely on locale's isprint().

I've just noticed that on OS X I get high-bit-set junk in the text
side of my hex/ASCII dumps. That's going to confuse all sorts of
things that will interpret them in the wrong character set (indeed, in
many cases there won't even be a _right_ character set). Coerce to
ordinary ASCII.
This commit is contained in:
Simon Tatham 2017-11-27 20:39:17 +00:00
parent 46cf862c31
commit cd3093bcfe

View File

@ -351,7 +351,7 @@ void log_packet(void *handle, int direction, int type,
}
dumpdata[10+2+3*(p%16)] = smalldata[0];
dumpdata[10+2+3*(p%16)+1] = smalldata[1];
dumpdata[10+1+3*16+2+(p%16)] = (isprint(c) ? c : '.');
dumpdata[10+1+3*16+2+(p%16)] = (c >= 0x20 && c < 0x7F ? c : '.');
output_pos = (p%16) + 1;
}