]> granicus.if.org Git - apache/commitdiff
Use ap_bin2hex instead of sprintf(..., "%02x". It gives the same output and is faster.
authorChristophe Jaillet <jailletc36@apache.org>
Sun, 6 Jan 2013 18:08:46 +0000 (18:08 +0000)
committerChristophe Jaillet <jailletc36@apache.org>
Sun, 6 Jan 2013 18:08:46 +0000 (18:08 +0000)
No real speedup should be achieved on production machine, because this is done
only for characters that need to be escaped.
However, this will close PR 50919.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1429564 13f79535-47bb-0310-9956-ffa450edef68

modules/loggers/mod_log_forensic.c

index 7cbb76dff249b991f673a24e8e00851a2ee7384f..f29aec3ef7b1acff22a0df8dd960c7b7b08f0f5c 100644 (file)
@@ -126,7 +126,7 @@ static char *log_escape(char *q, const char *e, const char *p)
         if (test_char_table[*(unsigned char *)p]&T_ESCAPE_FORENSIC) {
             ap_assert(q+2 < e);
             *q++ = '%';
-            sprintf(q, "%02x", *(unsigned char *)p);
+            ap_bin2hex(p, 1, q);
             q += 2;
         }
         else