]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/messages.c
Minor bug fix in ldap_parse_extended_result.
[openldap] / libraries / libldap / messages.c
index eea7bed70c660c596968e749c813f49581f3d8ca..57e331daeb093cc1426eda758298b0fa6e70c79a 100644 (file)
@@ -1,3 +1,4 @@
+/* $OpenLDAP$ */
 /*
  * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
 
 #include "ldap-int.h"
 
-/* ARGSUSED */
 LDAPMessage *
 ldap_first_message( LDAP *ld, LDAPMessage *chain )
 {
-       return( ld == NULL || chain == NULLMSG
-                       ? NULLMSG : chain );
+       assert( ld != NULL );
+       assert( LDAP_VALID( ld ) );
+
+       if ( ld == NULL || chain == NULL ) {
+               return NULL;
+       }
+       
+       return chain;
 }
 
-/* ARGSUSED */
 LDAPMessage *
 ldap_next_message( LDAP *ld, LDAPMessage *msg )
 {
-       if ( ld == NULL || msg == NULLMSG || msg->lm_chain == NULL ) {
-               return NULLMSG;
+       assert( ld != NULL );
+       assert( LDAP_VALID( ld ) );
+
+       if ( ld == NULL || msg == NULL || msg->lm_chain == NULL ) {
+               return NULL;
        }
 
        return( msg->lm_chain );
 }
 
-/* ARGSUSED */
 int
 ldap_count_messages( LDAP *ld, LDAPMessage *chain )
 {
        int     i;
 
+       assert( ld != NULL );
+       assert( LDAP_VALID( ld ) );
+
        if ( ld == NULL ) {
                return -1;
        }