]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
trace: 0x7F character is non-printable
authorViktor Szakats <commit@vsz.me>
Sun, 17 Jul 2022 10:10:35 +0000 (10:10 +0000)
committerViktor Szakats <commit@vsz.me>
Sun, 17 Jul 2022 10:10:35 +0000 (10:10 +0000)
`0x7F` is `DEL`, a non-printable symbol, so print it as
`UNPRINTABLE_CHAR`.

Reported-by: MasterInQuestion on github
Fixes #9162
Closes #9166

src/tool_cb_dbg.c

index ebeb8edf924d61080d450405ea273290d1fde706..c1dba85ab8ae3c623ad59da91768fb19c542b1e0 100644 (file)
@@ -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) &&