+/* $OpenLDAP$ */
/*
* Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
* ldap_int_put_controls
*/
-int ldap_int_put_controls(
+int
+ldap_int_put_controls(
LDAP *ld,
- LDAPControl **ctrls,
+ LDAPControl *const *ctrls,
BerElement *ber )
{
- LDAPControl **c;
+ LDAPControl *const *c;
assert( ld != NULL );
assert( ber != NULL );
char *opaque;
assert( ber != NULL );
- assert( ctrls != NULL );
+ if( ctrls == NULL ) {
+ return LDAP_SUCCESS;
+ }
*ctrls = NULL;
len = ber_pvt_ber_remaining(ber);
return LDAP_SUCCESS;
}
+
if(( tag = ber_peek_tag( ber, &len )) != LDAP_TAG_CONTROLS ) {
if( tag == LBER_ERROR ) {
/* decoding error */
assert( controls != NULL );
if ( controls != NULL ) {
- LDAPControl *c;
+ int i;
- for(c = *controls; c != NULL; c++) {
- ldap_control_free( c );
+ for( i=0; controls[i] != NULL; i++) {
+ ldap_control_free( controls[i] );
}
LDAP_FREE( controls );
/*
* Duplicate an array of LDAPControl
*/
-LDAPControl **ldap_controls_dup( LDAPControl **controls )
+LDAPControl **
+ldap_controls_dup( LDAPControl *const *controls )
{
LDAPControl **new;
int i;
/*
* Duplicate a LDAPControl
*/
-LDAPControl *ldap_control_dup( LDAPControl *c )
+LDAPControl *
+ldap_control_dup( const LDAPControl *c )
{
LDAPControl *new;