]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/attr.c
Code clean-up.
[openldap] / servers / slapd / attr.c
index 1aa239239588c557989755251035ce2f66bd9626..0d696dc02486058b66e229ebe802f936dbba74b9 100644 (file)
@@ -9,6 +9,7 @@
 #endif
 
 #include <ac/ctype.h>
+#include <ac/errno.h>
 #include <ac/socket.h>
 #include <ac/string.h>
 #include <ac/time.h>
 
 #include "slap.h"
 
-extern char    **charray_dup();
-extern char    *ch_malloc();
-extern int     errno;
-
 void
 attr_free( Attribute *a )
 {
@@ -80,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;
@@ -115,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;
@@ -295,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 );
@@ -326,7 +323,7 @@ attr_syntax_config(
 
 #ifdef LDAP_DEBUG
 
-static
+static int
 attr_syntax_printnode( struct asyntaxinfo *a )
 {
        int     i;
@@ -338,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 );