[or-cvs] Override our notion of printability for esc_for_log. 127 a...

Nick Mathewson nickm at seul.org
Fri Jun 9 15:58:01 UTC 2006


Update of /home/or/cvsroot/tor/src/common
In directory moria:/tmp/cvs-serv12398/src/common

Modified Files:
	util.c 
Log Message:
Override our notion of printability for esc_for_log.  127 and up are never printable.  Take that, locales.

Index: util.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/util.c,v
retrieving revision 1.259
retrieving revision 1.260
diff -u -p -d -r1.259 -r1.260
--- util.c	4 Jun 2006 22:42:12 -0000	1.259
+++ util.c	9 Jun 2006 15:57:58 -0000	1.260
@@ -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);



More information about the tor-commits mailing list