From 61c3a521fc1a017aa8fc0e84bed68dd1d4c5d930 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 16 Jul 2022 16:23:16 +0000 Subject: [PATCH] trace: 0x7f character is non-printable 0x7f is `DEL`, a non-printable symbol, so print it as `UNPRINTABLE_CHAR`. Reported-by: MasterInQuestion on github Fixes #9162 Closes #xxxx --- src/tool_cb_dbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tool_cb_dbg.c b/src/tool_cb_dbg.c index ebeb8edf924d61..c1dba85ab8ae3c 100644 --- a/src/tool_cb_dbg.c +++ b/src/tool_cb_dbg.c @@ -232,7 +232,7 @@ static void dump(const char *timebuf, const char *text, break; } (void)infotype; - fprintf(stream, "%c", ((ptr[i + c] >= 0x20) && (ptr[i + c] < 0x80)) ? + fprintf(stream, "%c", ((ptr[i + c] >= 0x20) && (ptr[i + c] < 0x7F)) ? ptr[i + c] : UNPRINTABLE_CHAR); /* check again for 0D0A, to avoid an extra \n if it's at width */ if((tracetype == TRACE_ASCII) &&