diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index b363035381..b55c46121d 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -289,7 +289,8 @@ main( int argc, char **argv ) /* set option error */ } if (referrals != -1 && - ldap_set_option( ld, LDAP_OPT_REFERRALS, (void *) referrals ) == -1 ) + ldap_set_option( ld, LDAP_OPT_REFERRALS, + (referrals ? LDAP_OPT_ON : LDAP_OPT_OFF) ) == -1 ) { /* set option error */ }