]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/index.c
Import slapd.conf mode change (with typo correction) from -devel.
[openldap] / servers / slapd / back-ldbm / index.c
index acb7844e8e9d6641d2c83cdec8deea136716228e..016be0644108895c329d9001321a243dd5240821 100644 (file)
@@ -99,9 +99,7 @@ index_read(
        char            *realval, *tmpval;
        char            buf[BUFSIZ];
 
-#ifdef HAVE_BERKELEY_DB2
-       memset( &key, 0, sizeof( key ) );
-#endif
+       ldbm_datum_init( key );
 
        prefix = index2prefix( indextype );
        Debug( LDAP_DEBUG_TRACE, "=> index_read( \"%s\" \"%c\" \"%s\" )\n",
@@ -127,7 +125,7 @@ index_read(
 
        realval = val;
        tmpval = NULL;
-       if ( prefix != '\0' ) {
+       if ( prefix != UNKNOWN_PREFIX ) {
               unsigned int     len = strlen( val );
 
               if ( (len + 2) < sizeof(buf) ) {
@@ -173,9 +171,7 @@ add_value(
        char    *realval, *tmpval, *s;
        char    buf[BUFSIZ];
 
-#ifdef HAVE_BERKELEY_DB2
-       memset( &key, 0, sizeof( key ) );
-#endif
+       ldbm_datum_init( key );
 
        prefix = index2prefix( indextype );
        Debug( LDAP_DEBUG_TRACE, "=> add_value( \"%c%s\" )\n", prefix, val, 0 );
@@ -183,7 +179,7 @@ add_value(
        realval = val;
        tmpval = NULL;
        idl = NULL;
-       if ( prefix != '\0' ) {
+       if ( prefix != UNKNOWN_PREFIX ) {
               unsigned int     len = strlen( val );
 
               if ( (len + 2) < sizeof(buf) ) {
@@ -357,7 +353,7 @@ index2prefix( int indextype )
                prefix = SUB_PREFIX;
                break;
        default:
-               prefix = '\0';
+               prefix = UNKNOWN_PREFIX;
                break;
        }