summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-06-09 15:57:58 +0000
committerNick Mathewson <nickm@torproject.org>2006-06-09 15:57:58 +0000
commit2936da4c28d1f131cf85e839ca70ee2914e75bdc (patch)
tree06c445df63685a836ac8d64ab63f5440d49f9cff /src/common
parent6531a31aad038c41670657b2a46d3c67d4b49789 (diff)
downloadtor-2936da4c28d1f131cf85e839ca70ee2914e75bdc.tar.gz
tor-2936da4c28d1f131cf85e839ca70ee2914e75bdc.zip
Override our notion of printability for esc_for_log. 127 and up are never printable. Take that, locales.
svn:r6578
Diffstat (limited to 'src/common')
-rw-r--r--src/common/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/util.c b/src/common/util.c
index fea53c5a1b..e7dc9ccbc8 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -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);