]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Save a couple characters' allocation in esc_for_log
authorFlorian Zumbiehl <florz@florz.de>
Mon, 14 Jun 2010 18:05:03 +0000 (14:05 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 14 Jun 2010 18:05:18 +0000 (14:05 -0400)
changes/less_alloc_for_esc [new file with mode: 0644]
src/common/util.c

diff --git a/changes/less_alloc_for_esc b/changes/less_alloc_for_esc
new file mode 100644 (file)
index 0000000..b10953a
--- /dev/null
@@ -0,0 +1,3 @@
+ o Minor bugfixes
+   - Save a couple bytes in memory allocation every time we escape
+     certain characters in a string.  Patch from Florian Zumbiehl.
index f5001abe6c1009a9efa3d63e3342d6b3bb425296..8531d12ebae7ccd360e60d99b2d7cff2d2f25922 100644 (file)
@@ -940,6 +940,9 @@ esc_for_log(const char *s)
       case '\\':
       case '\"':
       case '\'':
+      case '\r':
+      case '\n':
+      case '\t':
         len += 2;
         break;
       default: