X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Freferences.c;h=01fc0763046851d0e91d633c16d5e3884bf11ce1;hb=bcf8f7eeb788faa25efe0ea78e66e83e9d9b4d73;hp=bd2b79c12f6aba5680cca4c8eeb931074cdec403;hpb=1bcec8bf6a17a65396b2c947faed846d20428db9;p=openldap diff --git a/libraries/libldap/references.c b/libraries/libldap/references.c index bd2b79c12f..01fc076304 100644 --- a/libraries/libldap/references.c +++ b/libraries/libldap/references.c @@ -1,5 +1,6 @@ +/* $OpenLDAP$ */ /* - * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved. + * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. * COPYING RESTRICTIONS APPLY, see COPYRIGHT file */ /* @@ -9,7 +10,8 @@ #include "portable.h" #include -#include + +#include #include #include @@ -18,15 +20,15 @@ #include "ldap-int.h" -/* ARGSUSED */ LDAPMessage * ldap_first_reference( LDAP *ld, LDAPMessage *chain ) { assert( ld != NULL ); + assert( LDAP_VALID( ld ) ); assert( chain != NULL ); - if ( ld == NULL || chain == NULLMSG ) { - return NULLMSG; + if ( ld == NULL || chain == NULL ) { + return NULL; } return chain->lm_msgtype == LDAP_RES_SEARCH_REFERENCE @@ -38,15 +40,16 @@ LDAPMessage * ldap_next_reference( LDAP *ld, LDAPMessage *ref ) { assert( ld != NULL ); + assert( LDAP_VALID( ld ) ); assert( ref != NULL ); - if ( ld == NULL || ref == NULLMSG ) { - return NULLMSG; + if ( ld == NULL || ref == NULL ) { + return NULL; } for ( ref = ref->lm_chain; - ref != NULLMSG; + ref != NULL; ref = ref->lm_chain ) { if( ref->lm_msgtype == LDAP_RES_SEARCH_REFERENCE ) { @@ -54,7 +57,7 @@ ldap_next_reference( LDAP *ld, LDAPMessage *ref ) } } - return( NULLMSG ); + return( NULL ); } int @@ -63,12 +66,14 @@ ldap_count_references( LDAP *ld, LDAPMessage *chain ) int i; assert( ld != NULL ); + assert( LDAP_VALID( ld ) ); assert( chain != NULL ); if ( ld == NULL ) { return -1; } + for ( i = 0; chain != NULL; chain = chain->lm_chain ) { if( chain->lm_msgtype == LDAP_RES_SEARCH_REFERENCE ) { i++; @@ -91,6 +96,7 @@ ldap_parse_reference( int rc; assert( ld != NULL ); + assert( LDAP_VALID( ld ) ); assert( ref != NULL ); if( ld == NULL || ref == NULL ||