X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fattr.c;h=0d696dc02486058b66e229ebe802f936dbba74b9;hb=8a5bbf9b0808a17543cd7141623a91a79c633232;hp=7686d94767df285a23ad73347ff036fc5f7e0853;hpb=42e0d83cb3a1a1c5b25183f1ab74ce7edbe25de7;p=openldap diff --git a/servers/slapd/attr.c b/servers/slapd/attr.c index 7686d94767..0d696dc024 100644 --- a/servers/slapd/attr.c +++ b/servers/slapd/attr.c @@ -1,20 +1,26 @@ /* attr.c - routines for dealing with attributes */ +#include "portable.h" + #include -#include -#include + +#ifdef HAVE_FCNTL_H #include -#include -#include -#include +#endif + +#include +#include +#include +#include +#include + +#ifdef HAVE_SYS_PARAM_H #include +#endif + #include -#include "portable.h" -#include "slap.h" -extern char **charray_dup(); -extern char *ch_malloc(); -extern int errno; +#include "slap.h" void attr_free( Attribute *a ) @@ -71,7 +77,7 @@ attr_merge_fast( if ( **a == NULL ) { **a = (Attribute *) ch_malloc( sizeof(Attribute) ); - (**a)->a_type = attr_normalize( strdup( type ) ); + (**a)->a_type = attr_normalize( ch_strdup( type ) ); (**a)->a_vals = NULL; (**a)->a_syntax = attr_syntax( type ); (**a)->a_next = NULL; @@ -106,7 +112,7 @@ attr_merge( if ( *a == NULL ) { *a = (Attribute *) ch_malloc( sizeof(Attribute) ); - (*a)->a_type = attr_normalize( strdup( type ) ); + (*a)->a_type = attr_normalize( ch_strdup( type ) ); (*a)->a_vals = NULL; (*a)->a_syntax = attr_syntax( type ); (*a)->a_next = NULL; @@ -286,7 +292,7 @@ attr_syntax_config( } else { Debug( LDAP_DEBUG_ANY, "%s: line %d: unknown syntax \"%s\" in attribute line (ignored)\n", - fname, lineno, 0 ); + fname, lineno, argv[lasti] ); Debug( LDAP_DEBUG_ANY, "possible syntaxes are \"cis\", \"ces\", \"tel\", \"dn\", or \"bin\"\n", 0, 0, 0 ); @@ -298,7 +304,7 @@ attr_syntax_config( a->asi_names = charray_dup( argv ); argv[lasti] = save; - switch ( avl_insert( &attr_syntaxes, a, attr_syntax_cmp, + switch ( avl_insert( &attr_syntaxes, (caddr_t) a, attr_syntax_cmp, attr_syntax_dup ) ) { case -1: /* duplicate - different syntaxes */ Debug( LDAP_DEBUG_ARGS, "%s: line %d: duplicate attribute\n", @@ -317,7 +323,7 @@ attr_syntax_config( #ifdef LDAP_DEBUG -static +static int attr_syntax_printnode( struct asyntaxinfo *a ) { int i; @@ -329,8 +335,8 @@ attr_syntax_printnode( struct asyntaxinfo *a ) return( 0 ); } -static -attr_syntax_print() +static void +attr_syntax_print( void ) { (void) avl_apply( attr_syntaxes, attr_syntax_printnode, 0, -1, AVL_INORDER );