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
This commit is contained in:
Nick Mathewson
2006-03-05 09:50:26 +00:00
parent 6a4e304d9e
commit 5777ee0e1a
16 changed files with 261 additions and 95 deletions
+6
View File
@@ -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);
}