]> git.sur5r.net Git - openldap/commitdiff
fix control value generation (ITS#6652)
authorPierangelo Masarati <ando@openldap.org>
Sun, 2 Jan 2011 17:19:14 +0000 (17:19 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sun, 2 Jan 2011 17:19:14 +0000 (17:19 +0000)
servers/slapd/overlays/accesslog.c

index 8522c5e4a46e284b4dc50b742d1b907389d2c9a0..b339dc4cb6c3ad77ffd0a035cccc73872808982d 100644 (file)
@@ -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++ = '"';