Browse Source

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

svn:r6578
Nick Mathewson 19 years ago
parent
commit
2936da4c28
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/common/util.c

+ 2 - 2
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);