]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/ad.c
ITS#2919 move OpenLDAPtime to OpenLDAPperson
[openldap] / servers / slapd / ad.c
index 9b5805363edd18c934204253ebe4b7845807eb56..34f8cb4f20402b88c3e2d66371f6095d902b590f 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2004 The OpenLDAP Foundation.
+ * Copyright 1998-2005 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,6 @@
 #include <ac/string.h>
 #include <ac/time.h>
 
-#include "ldap_pvt.h"
 #include "slap.h"
 #include "lutil.h"
 
@@ -793,6 +792,7 @@ str2anlist( AttributeName *an, char *in, const char *brkstr )
        }
 
        an = ch_realloc( an, ( i + j + 1 ) * sizeof( AttributeName ) );
+       BER_BVZERO( &an[i + j].an_name );
        anew = an + i;
        for ( s = ldap_pvt_strtok( str, brkstr, &lasts );
                s != NULL;
@@ -899,7 +899,7 @@ anlist2attrs( AttributeName * anlist )
        attrs = anlist2charray( anlist, 1 );
                                                                                 
        for ( i = 0; anlist[i].an_name.bv_val; i++ ) {
-               if ( oc = anlist[i].an_oc ) {
+               if ( ( oc = anlist[i].an_oc ) ) {
                        for ( j = 0; oc->soc_required && oc->soc_required[j]; j++ ) ;
                        k += j;
                        for ( j = 0; oc->soc_allowed && oc->soc_allowed[j]; j++ ) ;
@@ -916,7 +916,7 @@ anlist2attrs( AttributeName * anlist )
                attrs = (char **) ch_realloc( attrs, (i + k + 1) * sizeof( char * ));
 
        for ( i = 0; anlist[i].an_name.bv_val; i++ ) {
-               if ( oc = anlist[i].an_oc ) {
+               if ( ( oc = anlist[i].an_oc ) ) {
                        for ( j = 0; oc->soc_required && oc->soc_required[j]; j++ ) {
                                attrs[n++] = ch_strdup(
                                                                oc->soc_required[j]->sat_cname.bv_val );
@@ -995,7 +995,7 @@ file2anlist( AttributeName *an, const char *fname, const char *brkstr )
        while ( fgets( lcur, LBUFSIZ, fp ) != NULL ) {
                char *str, *s, *next;
                const char *delimstr = brkstr;
-               if (c = strchr( lcur, '\n' )) {
+               if ( ( c = strchr( lcur, '\n' ) ) ) {
                        if ( c == line ) {
                                *c = '\0';
                        } else if ( *(c-1) == '\r' ) {