Skip to content

Commit 5b944c9

Browse files
committed
Do not print char >= 0x7f even if isprint returns nonzero
... which is seemingly caused by `setlocale(LC_CTYPE, "");`
1 parent b5113a1 commit 5b944c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void sftp_debug_hexdump(const void *ptr, size_t n) {
7575
output += 2;
7676
for(j = 0; j < 16; ++j)
7777
if(i + j < n)
78-
*output++ = isprint(p[i + j]) ? p[i + j] : '.';
78+
*output++ = (isprint(p[i + j]) && p[i + j] < 0x7f) ? p[i + j] : '.';
7979
*output++ = '\n';
8080
*output = 0;
8181
fputs(buffer, debugfp);

0 commit comments

Comments
 (0)