X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fsrchpref.c;h=4b54189c709e0d82c589a4fb9f8cad032c365c1e;hb=8045b54124f0365b3d34d9d3220256f052f2b76b;hp=64f1c1b1c7dc04100570bfb122176f05606e0985;hpb=1bcec8bf6a17a65396b2c947faed846d20428db9;p=openldap diff --git a/libraries/libldap/srchpref.c b/libraries/libldap/srchpref.c index 64f1c1b1c7..4b54189c70 100644 --- a/libraries/libldap/srchpref.c +++ b/libraries/libldap/srchpref.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 */ /* Portions @@ -20,7 +21,8 @@ #include "portable.h" #include -#include + +#include #include #include @@ -37,7 +39,7 @@ #include "ldap-int.h" static void free_searchobj LDAP_P(( struct ldap_searchobj *so )); -static int read_next_searchobj LDAP_P(( char **bufp, long *blenp, +static int read_next_searchobj LDAP_P(( char **bufp, ber_len_t *blenp, struct ldap_searchobj **sop, int soversion )); @@ -98,14 +100,16 @@ ldap_init_searchprefs( char *file, struct ldap_searchobj **solistp ) int -ldap_init_searchprefs_buf( char *buf, long buflen, +ldap_init_searchprefs_buf( + char *buf, + ber_len_t buflen, struct ldap_searchobj **solistp ) { int rc = -1, version; char **toks; struct ldap_searchobj *prevso, *so; - *solistp = prevso = NULLSEARCHOBJ; + *solistp = prevso = NULL; if ( next_line_tokens( &buf, &buflen, &toks ) != 2 || strcasecmp( toks[ 0 ], "version" ) != 0 ) { @@ -120,8 +124,8 @@ ldap_init_searchprefs_buf( char *buf, long buflen, } while ( buflen > 0 && ( rc = read_next_searchobj( &buf, &buflen, &so, - version )) == 0 && so != NULLSEARCHOBJ ) { - if ( prevso == NULLSEARCHOBJ ) { + version )) == 0 && so != NULL ) { + if ( prevso == NULL ) { *solistp = so; } else { prevso->so_next = so; @@ -223,13 +227,16 @@ ldap_first_searchobj( struct ldap_searchobj *solist ) struct ldap_searchobj * ldap_next_searchobj( struct ldap_searchobj *solist, struct ldap_searchobj *so ) { - return( so == NULLSEARCHOBJ ? so : so->so_next ); + return( so == NULL ? so : so->so_next ); } static int -read_next_searchobj( char **bufp, long *blenp, struct ldap_searchobj **sop, +read_next_searchobj( + char **bufp, + ber_len_t *blenp, + struct ldap_searchobj **sop, int soversion ) { int i, j, tokcnt;