From 7c77d9b801b9db0faeb1785a780cb767599dadb3 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sun, 2 Jan 2011 17:19:14 +0000 Subject: [PATCH] fix control value generation (ITS#6652) --- servers/slapd/overlays/accesslog.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/servers/slapd/overlays/accesslog.c b/servers/slapd/overlays/accesslog.c index 8522c5e4a4..b339dc4cb6 100644 --- a/servers/slapd/overlays/accesslog.c +++ b/servers/slapd/overlays/accesslog.c @@ -1173,25 +1173,9 @@ accesslog_ctrls( ber_len_t j; ptr = lutil_strcopy( ptr, " controlValue \"" ); - for ( j = 0; j < ctrls[ i ]->ldctl_value.bv_len; j++ ) - { - unsigned char o; - - o = ( ( ctrls[ i ]->ldctl_value.bv_val[ j ] >> 4 ) & 0xF ); - if ( o < 10 ) { - *ptr++ = '0' + o; - - } else { - *ptr++ = 'A' + o; - } - - o = ( ctrls[ i ]->ldctl_value.bv_val[ j ] & 0xF ); - if ( o < 10 ) { - *ptr++ = '0' + o; - - } else { - *ptr++ = 'A' + o; - } + for ( j = 0; j < ctrls[ i ]->ldctl_value.bv_len; j++ ) { + *ptr++ = SLAP_ESCAPE_HI(ctrls[ i ]->ldctl_value.bv_val[ j ]); + *ptr++ = SLAP_ESCAPE_LO(ctrls[ i ]->ldctl_value.bv_val[ j ]); } *ptr++ = '"'; -- 2.39.5