Override our notion of printability for esc_for_log. 127 and up are never printable. Take that, locales.

svn:r6578
This commit is contained in:
Nick Mathewson 2006-06-09 15:57:58 +00:00
parent 6531a31aad
commit 2936da4c28

View File

@ -589,7 +589,7 @@ esc_for_log(const char *s)
len += 2;
break;
default:
if (TOR_ISPRINT(*cp))
if (TOR_ISPRINT(*cp) && ((uint8_t)*cp)<127)
++len;
else
len += 4;
@ -620,7 +620,7 @@ esc_for_log(const char *s)
*outp++ = 'r';
break;
default:
if (TOR_ISPRINT(*cp)) {
if (TOR_ISPRINT(*cp) && ((uint8_t)*cp)<127) {
*outp++ = *cp;
} else {
tor_snprintf(outp, 5, "\\%03o", (uint8_t) *cp);