Permalink
Browse files

Use ap_bin2hex instead of sprintf(..., "%02x". It gives the same outp…

…ut 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
  • Loading branch information...
1 parent 24eb8dd commit 3dde13d7a62ce6c00c822f9989113a1aa61be34a Christophe Jaillet committed Jan 6, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 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

0 comments on commit 3dde13d

Please sign in to comment.