From 3dde13d7a62ce6c00c822f9989113a1aa61be34a Mon Sep 17 00:00:00 2001 From: Christophe Jaillet Date: Sun, 6 Jan 2013 18:08:46 +0000 Subject: [PATCH] Use ap_bin2hex instead of sprintf(..., "%02x". It gives the same output and is faster. 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/loggers/mod_log_forensic.c b/modules/loggers/mod_log_forensic.c index 7cbb76dff24..f29aec3ef7b 100644 --- a/modules/loggers/mod_log_forensic.c +++ b/modules/loggers/mod_log_forensic.c @@ -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 -- 2.47.3