From: Christophe Jaillet Date: Sun, 6 Jan 2013 18:08:46 +0000 (+0000) Subject: Use ap_bin2hex instead of sprintf(..., "%02x". It gives the same output and is faster. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3dde13d7a62ce6c00c822f9989113a1aa61be34a;p=thirdparty%2Fapache%2Fhttpd.git 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 --- 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