From: Pierangelo Masarati Date: Sun, 2 Jan 2011 17:19:14 +0000 (+0000) Subject: fix control value generation (ITS#6652) X-Git-Tag: MIGRATION_CVS2GIT~284 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7c77d9b801b9db0faeb1785a780cb767599dadb3;p=openldap fix control value generation (ITS#6652) --- 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++ = '"';