From: Pierangelo Masarati Date: Thu, 29 Aug 2002 10:49:41 +0000 (+0000) Subject: cleanup hasSubordinate operational attr merge X-Git-Tag: NO_SLAP_OP_BLOCKS~1117 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a32f8c079addfe1cc4592e4c905bf72f69aba2ad;p=openldap cleanup hasSubordinate operational attr merge --- diff --git a/servers/slapd/operational.c b/servers/slapd/operational.c index b9396b2473..f6b45221f8 100644 --- a/servers/slapd/operational.c +++ b/servers/slapd/operational.c @@ -40,14 +40,24 @@ Attribute * slap_operational_hasSubordinate( int hs ) { Attribute *a; - + char *val; + ber_len_t len; + + if ( hs ) { + val = "TRUE"; + len = sizeof( "TRUE" ) - 1; + + } else { + val = "FALSE"; + len = sizeof( "FALSE" ) - 1; + + } + a = ch_malloc( sizeof( Attribute ) ); a->a_desc = slap_schema.si_ad_hasSubordinates; - a->a_vals = ch_malloc( 2 * sizeof( struct berval ) ); - ber_str2bv( hs ? "TRUE" : "FALSE", - hs ? sizeof("TRUE")-1 : sizeof("FALSE")-1, - 1, a->a_vals ); + + ber_str2bv( val, len, 1, a->a_vals ); a->a_vals[1].bv_val = NULL; a->a_next = NULL;