diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-03-05 09:50:26 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-03-05 09:50:26 +0000 |
commit | 5777ee0e1a8bf0652aff75bb2c316c5bbbb4b854 (patch) | |
tree | e410cb36f9345a0aa46b735ca2128da55a68c152 /src/or/test.c | |
parent | 6a4e304d9e613b613e208bb0f11ec44c3fc30150 (diff) | |
download | tor-5777ee0e1a8bf0652aff75bb2c316c5bbbb4b854.tar.gz tor-5777ee0e1a8bf0652aff75bb2c316c5bbbb4b854.zip |
Add some functions to escape values from the network before sending them to the log. Use them everywhere except for routerinfo->plaftorm, routerinfo->contact_info, and rend*.c. (need sleep now)
svn:r6087
Diffstat (limited to 'src/or/test.c')
-rw-r--r-- | src/or/test.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/or/test.c b/src/or/test.c index c55ec5f4dc..2002c6a234 100644 --- a/src/or/test.c +++ b/src/or/test.c @@ -913,6 +913,12 @@ test_util(void) test_streq(tmpbuf, "18.244.0.188"); } + /* Test 'escaped' */ + test_streq("\"\"", escaped("")); + test_streq("\"abcd\"", escaped("abcd")); + test_streq("\"\\\\\\n\\r\\t\\\"\\'\"", escaped("\\\n\r\t\"\'")); + test_streq("\"z\\001abc\\277d\"", escaped("z\001abc\277d")); + /* XXXX test older functions. */ smartlist_free(sl); } |