aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2013-06-12 16:23:16 +0300
committerNick Mathewson <nickm@torproject.org>2013-07-18 08:45:02 -0400
commitea72958f25f6326d6947c8cd4ef185912582d436 (patch)
tree8e5913b7f68caca5e184b1a8e737eb1bea2212de /src/common/util.c
parent6cfc2b5d73f6ec1b2ab4af1f209b6126a7d8cba9 (diff)
downloadtor-ea72958f25f6326d6947c8cd4ef185912582d436.tar
tor-ea72958f25f6326d6947c8cd4ef185912582d436.tar.gz
Pass characters to be escaped to tor_escape_str_for_socks_arg().
This is in preparation for using tor_escape_str_for_socks_arg() to escape server-side pluggable transport parameters.
Diffstat (limited to 'src/common/util.c')
-rw-r--r--src/common/util.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/common/util.c b/src/common/util.c
index d9913dda4..bd38a6280 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -1223,17 +1223,15 @@ escaped(const char *s)
return escaped_val_;
}
-/** Escape every ";" or "\" character of <b>string</b>. Use
- * <b>escape_char</b> as the character to use for escaping.
- * The returned string is allocated on the heap and it's the
- * responsibility of the caller to free it. */
+/** Escape every character of <b>string</b> that is in
+ * <b>chars_to_escape</b>. The returned string is allocated on the
+ * heap and it's the responsibility of the caller to free it. */
char *
-tor_escape_str_for_socks_arg(const char *string)
+tor_escape_str_for_socks_arg(const char *string, const char *chars_to_escape)
{
char *new_string = NULL;
char *new_cp = NULL;
size_t length, new_length;
- static const char *chars_to_escape = ";\\";
tor_assert(string);