mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-21 22:17:53 +00:00
Small improvement in toprint()
This commit is contained in:
parent
c09582a220
commit
0c260a966e
4
log.c
4
log.c
@ -266,7 +266,9 @@ char *toprint(char *dstStr, size_t dstChars, const unsigned char *srcBuf, size_t
|
||||
strbuf_puts(b, "\\r");
|
||||
else if (*srcBuf == '\t')
|
||||
strbuf_puts(b, "\\t");
|
||||
else if (isprint(*srcBuf))
|
||||
else if (*srcBuf == '\\')
|
||||
strbuf_puts(b, "\\\\");
|
||||
else if (*srcBuf >= ' ' && *srcBuf <= '~')
|
||||
strbuf_putc(b, *srcBuf);
|
||||
else
|
||||
strbuf_sprintf(b, "\\x%02x", *srcBuf);
|
||||
|
Loading…
Reference in New Issue
Block a user