From: Howard Chu Date: Fri, 28 Oct 2005 01:57:40 +0000 (+0000) Subject: ITS#4111 fix mask_to_verbs return value X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~185 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3200892a950279522564d8cb9596a6ad0fa2d215;p=openldap ITS#4111 fix mask_to_verbs return value --- diff --git a/servers/slapd/config.c b/servers/slapd/config.c index 8d5544183d..b462046dd7 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -853,18 +853,20 @@ verbs_to_mask(int argc, char *argv[], slap_verbmasks *v, slap_mask_t *m) { */ int mask_to_verbs(slap_verbmasks *v, slap_mask_t m, BerVarray *bva) { - int i; - - if (!m) return 1; - for (i=0; !BER_BVISNULL(&v[i].word); i++) { - if (!v[i].mask) continue; - if (( m & v[i].mask ) == v[i].mask ) { - value_add_one( bva, &v[i].word ); - m ^= v[i].mask; - if ( !m ) break; + int i, rc = 1; + + if (m) { + for (i=0; !BER_BVISNULL(&v[i].word); i++) { + if (!v[i].mask) continue; + if (( m & v[i].mask ) == v[i].mask ) { + value_add_one( bva, &v[i].word ); + rc = 0; + m ^= v[i].mask; + if ( !m ) break; + } } } - return 0; + return rc; } int