From a56c161bdbc1443808039d0eaf9b84474a243352 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Sat, 10 Jun 2000 22:39:30 +0000 Subject: [PATCH] Misc code cleanup. --- clients/ud/find.c | 2 +- clients/ud/mod.c | 2 +- clients/ud/print.c | 2 +- clients/ud/string_to_key.c | 8 +++---- libraries/liblber/bprint.c | 6 ++--- libraries/liblber/sockbuf.c | 4 ++-- libraries/libldap/cache.c | 2 +- libraries/libldap/cldap.c | 2 +- libraries/libldap/os-ip.c | 4 ++-- libraries/libldap/os-local.c | 2 +- libraries/libldap/sasl.c | 2 +- libraries/libldap/tmplout.c | 2 +- libraries/libldap_r/rdwr.c | 2 +- libraries/libldbm/ldbm.c | 4 ++-- libraries/liblunicode/ucdata/ucgendat.c | 2 +- libraries/liblunicode/ure/ure.c | 8 +++---- libraries/liblunicode/utbm/utbm.c | 2 +- libraries/liblutil/lockf.c | 4 ++-- libraries/liblutil/md5.c | 8 +++---- libraries/liblutil/sockpair.c | 2 +- servers/slapd/acl.c | 4 ++-- servers/slapd/back-dnssrv/init.c | 2 +- servers/slapd/back-ldap/init.c | 2 +- servers/slapd/back-ldbm/back-ldbm.h | 2 -- servers/slapd/back-ldbm/cache.c | 1 + servers/slapd/back-ldbm/idl.c | 31 +++++++++++-------------- servers/slapd/back-ldbm/init.c | 2 +- servers/slapd/back-passwd/init.c | 2 +- servers/slapd/back-perl/init.c | 4 ++-- servers/slapd/back-shell/init.c | 2 +- servers/slapd/back-sql/init.c | 2 +- servers/slapd/back-tcl/tcl_init.c | 2 +- servers/slapd/sasl.c | 2 +- servers/slapd/slap.h | 3 --- servers/slurpd/st.c | 2 +- 35 files changed, 62 insertions(+), 71 deletions(-) diff --git a/clients/ud/find.c b/clients/ud/find.c index 2d42ae7768..f247fcc5bf 100644 --- a/clients/ud/find.c +++ b/clients/ud/find.c @@ -96,7 +96,7 @@ disambiguate( LDAPMessage *result, int matches, char **read_attrs, char *who ) for (;;) { printf(" Do you wish to see a list of names? "); fflush(stdout); - (void) memset(response, 0, sizeof(response)); + (void) memset(response, '\0', sizeof(response)); fetch_buffer(response, sizeof(response), stdin); switch (response[0]) { case 'n' : diff --git a/clients/ud/mod.c b/clients/ud/mod.c index 826f3db523..1a13a967f2 100644 --- a/clients/ud/mod.c +++ b/clients/ud/mod.c @@ -397,7 +397,7 @@ get_value( char *id, char *prompt ) * Other attributes may not. */ count = 1; - (void) memset(buffer, 0, sizeof(buffer)); + (void) memset(buffer, '\0', sizeof(buffer)); #ifdef UOFM if (!strcmp(id, "postalAddress") || !strcmp(id, "homePostalAddress") || !strcmp(id, "multiLineDescription") || !strcmp(id, "vacationMessage")) #else diff --git a/clients/ud/print.c b/clients/ud/print.c index e5e5e96e16..914b3e3d1b 100644 --- a/clients/ud/print.c +++ b/clients/ud/print.c @@ -575,7 +575,7 @@ time2text( char *ldtimestr, int dateonly ) return( fmterr ); } - memset( (char *)&t, 0, sizeof( struct tm )); + memset( (char *)&t, '\0', sizeof( struct tm )); p = ldtimestr; diff --git a/clients/ud/string_to_key.c b/clients/ud/string_to_key.c index 0fc51a2243..120cde80cf 100644 --- a/clients/ud/string_to_key.c +++ b/clients/ud/string_to_key.c @@ -67,7 +67,7 @@ des_string_to_key( char *str, register des_cblock *key ) length = strlen(str); /* init key array for bits */ - memset(k_char, 0, sizeof(k_char)); + memset(k_char, '\0', sizeof(k_char)); #ifdef USE_DES_DEBUG if (des_debug) @@ -116,7 +116,7 @@ des_string_to_key( char *str, register des_cblock *key ) (void) des_key_sched(key,key_sked); (void) des_cbc_cksum((des_cblock *)in_str,key,length,key_sked,key); /* erase key_sked */ - memset((char *)key_sked, 0, sizeof(key_sked)); + memset((char *)key_sked, '\0', sizeof(key_sked)); /* now fix up key parity again */ des_fixup_key_parity(key); @@ -160,8 +160,8 @@ Andrew_StringToKey( int i; int passlen; - memset(key, 0, sizeof(des_cblock)); - memset(password, 0, sizeof(password)); + memset(key, '\0', sizeof(des_cblock)); + memset(password, '\0', sizeof(password)); strncpy (password, cell, 8); passlen = strlen (str); diff --git a/libraries/liblber/bprint.c b/libraries/liblber/bprint.c index ec2949eb71..2d3fd7f6e9 100644 --- a/libraries/liblber/bprint.c +++ b/libraries/liblber/bprint.c @@ -43,7 +43,7 @@ int * ber_errno_addr(void) * Print stuff */ static void -ber_error_print( char *data ) +ber_error_print( const char *data ) { assert( data != NULL ); @@ -147,7 +147,7 @@ ber_bprint( assert( data != NULL ); - memset( out, 0, BPLEN ); + memset( out, '\0', BPLEN ); for ( ;; ) { if ( len < 1 ) { sprintf( buf, "\t%s\n", ( i == 0 ) ? "(end)" : out ); @@ -174,7 +174,7 @@ ber_bprint( char data[128 + BPLEN]; sprintf( data, "\t%s\n", out ); (*ber_pvt_log_print)(data); - memset( out, 0, BPLEN ); + memset( out, '\0', BPLEN ); i = 0; continue; } diff --git a/libraries/liblber/sockbuf.c b/libraries/liblber/sockbuf.c index c648ebb967..e3ddbcd44a 100644 --- a/libraries/liblber/sockbuf.c +++ b/libraries/liblber/sockbuf.c @@ -145,7 +145,7 @@ ber_sockbuf_add_io( Sockbuf *sb, Sockbuf_IO *sbio, int layer, void *arg ) d->sbiod_level = layer; d->sbiod_sb = sb; d->sbiod_io = sbio; - memset( &d->sbiod_pvt, 0, sizeof( d->sbiod_pvt ) ); + memset( &d->sbiod_pvt, '\0', sizeof( d->sbiod_pvt ) ); d->sbiod_next = p; *q = d; @@ -561,7 +561,7 @@ sb_dgram_setup( Sockbuf_IO_Desc *sbiod, void *arg ) p = LBER_MALLOC( sizeof( *p ) ); if ( p == NULL ) return -1; - memset( p, 0, sizeof( *p ) ); + memset( p, '\0', sizeof( *p ) ); sbiod->sbiod_pvt = (void *)p; if ( arg != NULL ) sbiod->sbiod_sb->sb_fd = *((int *)arg); diff --git a/libraries/libldap/cache.c b/libraries/libldap/cache.c index af2f583f77..93e0e31083 100644 --- a/libraries/libldap/cache.c +++ b/libraries/libldap/cache.c @@ -44,7 +44,7 @@ ldap_enable_cache( LDAP *ld, long timeout, ber_len_t maxmem ) ld->ld_errno = LDAP_NO_MEMORY; return( -1 ); } - (void) memset( ld->ld_cache, 0, sizeof( LDAPCache )); + (void) memset( ld->ld_cache, '\0', sizeof( LDAPCache )); ld->ld_cache->lc_memused = sizeof( LDAPCache ); } diff --git a/libraries/libldap/cldap.c b/libraries/libldap/cldap.c index 9a4eac20ff..50839df1fa 100644 --- a/libraries/libldap/cldap.c +++ b/libraries/libldap/cldap.c @@ -227,7 +227,7 @@ cldap_search_s( LDAP *ld, *res = NULL; - (void) memset( &cri, 0, sizeof( cri )); + (void) memset( &cri, '\0', sizeof( cri )); if ( logdn != NULL ) { ld->ld_cldapdn = logdn; diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index e300711817..c1c75e894b 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -324,7 +324,7 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *sb, const char *host, break; } - (void)memset((char *)&sin, 0, sizeof(struct sockaddr_in)); + (void)memset((char *)&sin, '\0', sizeof(struct sockaddr_in)); sin.sin_family = AF_INET; sin.sin_port = port; p = (char *)&sin.sin_addr; @@ -365,7 +365,7 @@ ldap_host_connected_to( Sockbuf *sb ) ber_socket_t sd; #define DO_RETURN(x) if (ha_buf) LDAP_FREE(ha_buf); return (x); - (void)memset( (char *)&sin, 0, sizeof( struct sockaddr_in )); + (void)memset( (char *)&sin, '\0', sizeof( struct sockaddr_in )); len = sizeof( sin ); ber_sockbuf_ctrl( sb, LBER_SB_OPT_GET_FD, &sd ); diff --git a/libraries/libldap/os-local.c b/libraries/libldap/os-local.c index df4196266f..6d45b2589a 100644 --- a/libraries/libldap/os-local.c +++ b/libraries/libldap/os-local.c @@ -201,7 +201,7 @@ ldap_connect_to_path(LDAP *ld, Sockbuf *sb, const char *path, int async) oslocal_debug(ld, "ldap_connect_to_path: Trying %s\n", path, 0, 0); - memset( &server, 0, sizeof(server) ); + memset( &server, '\0', sizeof(server) ); server.sun_family = AF_UNIX; strcpy( server.sun_path, path ); diff --git a/libraries/libldap/sasl.c b/libraries/libldap/sasl.c index de430695f9..1243454d76 100644 --- a/libraries/libldap/sasl.c +++ b/libraries/libldap/sasl.c @@ -835,7 +835,7 @@ ldap_pvt_sasl_bind( } sasl_setprop( ld->ld_sasl_context, SASL_IP_LOCAL, &sin ); - memset( &secprops, 0, sizeof( secprops ) ); + memset( &secprops, '\0', sizeof( secprops ) ); secprops.min_ssf = ld->ld_options.ldo_sasl_minssf; secprops.max_ssf = ld->ld_options.ldo_sasl_maxssf; secprops.security_flags = SASL_SECURITY_LAYER; diff --git a/libraries/libldap/tmplout.c b/libraries/libldap/tmplout.c index e6707cfae9..385312256f 100644 --- a/libraries/libldap/tmplout.c +++ b/libraries/libldap/tmplout.c @@ -901,7 +901,7 @@ time2text( char *ldtimestr, int dateonly ) return( fmterr ); } - memset( (char *)&t, 0, sizeof( struct tm )); + memset( (char *)&t, '\0', sizeof( struct tm )); p = ldtimestr; diff --git a/libraries/libldap_r/rdwr.c b/libraries/libldap_r/rdwr.c index e97fe7143c..5e04a43a62 100644 --- a/libraries/libldap_r/rdwr.c +++ b/libraries/libldap_r/rdwr.c @@ -34,7 +34,7 @@ ldap_pvt_thread_rdwr_init( ldap_pvt_thread_rdwr_t *rw ) { assert( rw != NULL ); - memset( rw, 0, sizeof(ldap_pvt_thread_rdwr_t) ); + memset( rw, '\0', sizeof(ldap_pvt_thread_rdwr_t) ); /* we should check return results */ ldap_pvt_thread_mutex_init( &rw->ltrw_mutex ); diff --git a/libraries/libldbm/ldbm.c b/libraries/libldbm/ldbm.c index 6555caf510..2560fd8727 100644 --- a/libraries/libldbm/ldbm.c +++ b/libraries/libldbm/ldbm.c @@ -30,7 +30,7 @@ ldbm_datum_free( LDBM ldbm, Datum data ) { if ( data.dptr ) { free( data.dptr ); - memset( &data, 0, sizeof( Datum )); + memset( &data, '\0', sizeof( Datum )); data.dptr = NULL; } } @@ -263,7 +263,7 @@ ldbm_open( char *name, int rw, int mode, int dbcachesize ) #elif DB_VERSION_MAJOR >= 2 DB_INFO dbinfo; - memset( &dbinfo, 0, sizeof( dbinfo )); + memset( &dbinfo, '\0', sizeof( dbinfo )); #if defined( DB_VERSION_MAJOR ) && defined( DB_VERSION_MINOR ) && \ DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 4 diff --git a/libraries/liblunicode/ucdata/ucgendat.c b/libraries/liblunicode/ucdata/ucgendat.c index 06ebc5da95..836a2ef69f 100644 --- a/libraries/liblunicode/ucdata/ucgendat.c +++ b/libraries/liblunicode/ucdata/ucgendat.c @@ -436,7 +436,7 @@ add_decomp(unsigned long code) decomps = (_decomp_t *) realloc((char *) decomps, sizeof(_decomp_t) * (decomps_size + 8)); - (void) memset((char *) (decomps + decomps_size), 0, + (void) memset((char *) (decomps + decomps_size), '\0', sizeof(_decomp_t) << 3); decomps_size += 8; } diff --git a/libraries/liblunicode/ure/ure.c b/libraries/liblunicode/ure/ure.c index aa1bf2feac..51821f97f1 100644 --- a/libraries/liblunicode/ure/ure.c +++ b/libraries/liblunicode/ure/ure.c @@ -1077,7 +1077,7 @@ _ure_make_symbol(ucs2_t *sym, unsigned long limit, unsigned long *consumed, * Build the next symbol so we can test to see if it is already in the * symbol table. */ - (void) memset((char *) &symbol, 0, sizeof(_ure_symtab_t)); + (void) memset((char *) &symbol, '\0', sizeof(_ure_symtab_t)); *consumed = _ure_compile_symbol(sym, limit, &symbol, b); /* @@ -1108,7 +1108,7 @@ _ure_make_symbol(ucs2_t *sym, unsigned long limit, unsigned long *consumed, realloc((char *) b->symtab, sizeof(_ure_symtab_t) * (b->symtab_size + 8)); sp = b->symtab + b->symtab_size; - (void) memset((char *) sp, 0, sizeof(_ure_symtab_t) << 3); + (void) memset((char *) sp, '\0', sizeof(_ure_symtab_t) << 3); b->symtab_size += 8; } @@ -1329,7 +1329,7 @@ _ure_add_state(ucs2_t nstates, ucs2_t *states, _ure_buffer_t *b) realloc((char *) b->states.states, sizeof(_ure_state_t) * (b->states.states_size + 8)); sp = b->states.states + b->states.states_size; - (void) memset((char *) sp, 0, sizeof(_ure_state_t) << 3); + (void) memset((char *) sp, '\0', sizeof(_ure_state_t) << 3); b->states.states_size += 8; } @@ -1734,7 +1734,7 @@ ure_compile(ucs2_t *re, unsigned long relen, int casefold, ure_buffer_t buf) * Construct the minimal DFA. */ dfa = (ure_dfa_t) malloc(sizeof(_ure_dfa_t)); - (void) memset((char *) dfa, 0, sizeof(_ure_dfa_t)); + (void) memset((char *) dfa, '\0', sizeof(_ure_dfa_t)); dfa->flags = buf->flags & (_URE_DFA_CASEFOLD|_URE_DFA_BLANKLINE); diff --git a/libraries/liblunicode/utbm/utbm.c b/libraries/liblunicode/utbm/utbm.c index 863f2c5c6a..a3e312cc12 100644 --- a/libraries/liblunicode/utbm/utbm.c +++ b/libraries/liblunicode/utbm/utbm.c @@ -223,7 +223,7 @@ utbm_create_pattern(void) utbm_pattern_t p; p = (utbm_pattern_t) malloc(sizeof(_utbm_pattern_t)); - (void) memset((char *) p, 0, sizeof(_utbm_pattern_t)); + (void) memset((char *) p, '\0', sizeof(_utbm_pattern_t)); return p; } diff --git a/libraries/liblutil/lockf.c b/libraries/liblutil/lockf.c index 69c4009086..7ba5c0ea50 100644 --- a/libraries/liblutil/lockf.c +++ b/libraries/liblutil/lockf.c @@ -79,7 +79,7 @@ int lutil_unlockf ( int fd ) { int lutil_lockf ( int fd ) { struct flock file_lock; - memset( &file_lock, 0, sizeof( file_lock ) ); + memset( &file_lock, '\0', sizeof( file_lock ) ); file_lock.l_type = F_WRLCK; file_lock.l_whence = SEEK_SET; file_lock.l_start = 0; @@ -92,7 +92,7 @@ int lutil_lockf ( int fd ) { int lutil_unlockf ( int fd ) { struct flock file_lock; - memset( &file_lock, 0, sizeof( file_lock ) ); + memset( &file_lock, '\0', sizeof( file_lock ) ); file_lock.l_type = F_UNLCK; file_lock.l_whence = SEEK_SET; file_lock.l_start = 0; diff --git a/libraries/liblutil/md5.c b/libraries/liblutil/md5.c index 486fbe2594..9ce509f8ff 100644 --- a/libraries/liblutil/md5.c +++ b/libraries/liblutil/md5.c @@ -157,14 +157,14 @@ lutil_MD5Final( unsigned char *digest, struct lutil_MD5Context *ctx ) /* Pad out to 56 mod 64 */ if (count < 8) { /* Two lots of padding: Pad the first block to 64 bytes */ - memset(p, 0, count); + memset(p, '\0', count); lutil_MD5Transform(ctx->buf, ctx->in); /* Now fill the next block with 56 bytes */ - memset(ctx->in, 0, 56); + memset(ctx->in, '\0', 56); } else { /* Pad block to 56 bytes */ - memset(p, 0, count-8); + memset(p, '\0', count-8); } /* Append length in bits and transform */ @@ -176,7 +176,7 @@ lutil_MD5Final( unsigned char *digest, struct lutil_MD5Context *ctx ) putu32(ctx->buf[1], digest + 4); putu32(ctx->buf[2], digest + 8); putu32(ctx->buf[3], digest + 12); - memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ + memset(ctx, '\0', sizeof(ctx)); /* In case it's sensitive */ } #ifndef ASM_MD5 diff --git a/libraries/liblutil/sockpair.c b/libraries/liblutil/sockpair.c index 22cd9887db..648009d315 100644 --- a/libraries/liblutil/sockpair.c +++ b/libraries/liblutil/sockpair.c @@ -33,7 +33,7 @@ int lutil_pair( LBER_SOCKET_T sds[2] ) if ( sd == AC_SOCKET_INVALID ) return sd; - (void) memset( (void*) &si, 0, len ); + (void) memset( (void*) &si, '\0', len ); si.sin_family = AF_INET; si.sin_port = 0; si.sin_addr.s_addr = htonl( INADDR_LOOPBACK ); diff --git a/servers/slapd/acl.c b/servers/slapd/acl.c index 771fa341a4..c9b4d41df3 100644 --- a/servers/slapd/acl.c +++ b/servers/slapd/acl.c @@ -141,7 +141,7 @@ access_allowed( } ACL_INIT(mask); - memset(matches, 0, sizeof(matches)); + memset(matches, '\0', sizeof(matches)); control = ACL_BREAK; a = NULL; @@ -171,7 +171,7 @@ access_allowed( break; } - memset(matches, 0, sizeof(matches)); + memset(matches, '\0', sizeof(matches)); } if ( ACL_IS_INVALID( mask ) ) { diff --git a/servers/slapd/back-dnssrv/init.c b/servers/slapd/back-dnssrv/init.c index 7e7679f8cd..9a77eff1dd 100644 --- a/servers/slapd/back-dnssrv/init.c +++ b/servers/slapd/back-dnssrv/init.c @@ -19,7 +19,7 @@ int back_dnssrv_LTX_init_module(int argc, char *argv[]) { BackendInfo bi; - memset( &bi, 0, sizeof(bi) ); + memset( &bi, '\0', sizeof(bi) ); bi.bi_type = "dnssrv"; bi.bi_init = dnssrv_back_initialize; diff --git a/servers/slapd/back-ldap/init.c b/servers/slapd/back-ldap/init.c index 7144c9331e..98d9191ec3 100644 --- a/servers/slapd/back-ldap/init.c +++ b/servers/slapd/back-ldap/init.c @@ -36,7 +36,7 @@ int back_ldap_LTX_init_module(int argc, char *argv[]) { BackendInfo bi; - memset( &bi, 0, sizeof(bi) ); + memset( &bi, '\0', sizeof(bi) ); bi.bi_type = "ldap"; bi.bi_init = ldap_back_initialize; diff --git a/servers/slapd/back-ldbm/back-ldbm.h b/servers/slapd/back-ldbm/back-ldbm.h index 911140d003..6ea8e8c3a1 100644 --- a/servers/slapd/back-ldbm/back-ldbm.h +++ b/servers/slapd/back-ldbm/back-ldbm.h @@ -23,8 +23,6 @@ LDAP_BEGIN_DECL #define DEFAULT_DB_DIRECTORY LDAP_RUNDIR LDAP_DIRSEP "openldap-ldbm" #define DEFAULT_MODE 0600 -#define SUBLEN 3 - #define DN_BASE_PREFIX SLAP_INDEX_EQUALITY_PREFIX #define DN_ONE_PREFIX '%' #define DN_SUBTREE_PREFIX '@' diff --git a/servers/slapd/back-ldbm/cache.c b/servers/slapd/back-ldbm/cache.c index 819e2a8130..c1ad171020 100644 --- a/servers/slapd/back-ldbm/cache.c +++ b/servers/slapd/back-ldbm/cache.c @@ -36,6 +36,7 @@ typedef struct ldbm_entry_info { Entry *lei_lrunext; /* for cache lru list */ Entry *lei_lruprev; } EntryInfo; +#undef LEI #define LEI(e) ((EntryInfo *) ((e)->e_private)) static int cache_delete_entry_internal(Cache *cache, Entry *e); diff --git a/servers/slapd/back-ldbm/idl.c b/servers/slapd/back-ldbm/idl.c index dc37bf57b9..7d18956361 100644 --- a/servers/slapd/back-ldbm/idl.c +++ b/servers/slapd/back-ldbm/idl.c @@ -173,7 +173,7 @@ idl_fetch( if ( (tmp[i] = idl_fetch_one( be, db, data )) == NULL ) { Debug( LDAP_DEBUG_ANY, - "idl_fetch of (%s) returns NULL\n", data.dptr, 0, 0 ); + "idl_fetch: one returned NULL\n", 0, 0, 0 ); continue; } @@ -313,8 +313,8 @@ idl_change_first( /* delete old key block */ if ( (rc = ldbm_cache_delete( db, bkey )) != 0 ) { Debug( LDAP_DEBUG_ANY, - "ldbm_delete of (%s) returns %d\n", bkey.dptr, rc, - 0 ); + "idl_change_first: ldbm_cache_delete returned %d\n", + rc, 0, 0 ); return( rc ); } @@ -323,7 +323,7 @@ idl_change_first( if ( (rc = idl_store( be, db, bkey, b )) != 0 ) { Debug( LDAP_DEBUG_ANY, - "idl_store of (%s) returns %d\n", bkey.dptr, rc, 0 ); + "idl_change_first: idl_store returned %d\n", rc, 0, 0 ); return( rc ); } @@ -331,7 +331,7 @@ idl_change_first( ID_BLOCK_ID(h, pos) = ID_BLOCK_ID(b, 0); if ( (rc = idl_store( be, db, hkey, h )) != 0 ) { Debug( LDAP_DEBUG_ANY, - "idl_store of (%s) returns %d\n", hkey.dptr, rc, 0 ); + "idl_change_first: idl_store returned %d\n", rc, 0, 0 ); return( rc ); } @@ -352,11 +352,6 @@ idl_insert_key( Datum k2; if ( (idl = idl_fetch_one( be, db, key )) == NULL ) { -#ifdef LDBM_DEBUG - Statslog( LDAP_DEBUG_STATS, "=> idl_insert_key(): no key yet\n", - 0, 0, 0, 0, 0 ); -#endif - idl = idl_alloc( 1 ); ID_BLOCK_ID(idl, ID_BLOCK_NIDS(idl)++) = id; rc = idl_store( be, db, key, idl ); @@ -449,8 +444,8 @@ idl_insert_key( cont_id( k2, ID_BLOCK_ID(idl, i) ); if ( (tmp = idl_fetch_one( be, db, k2 )) == NULL ) { - Debug( LDAP_DEBUG_ANY, "nonexistent continuation block (%s)\n", - k2.dptr, 0, 0 ); + Debug( LDAP_DEBUG_ANY, "idl_insert_key: nonexistent continuation block\n", + 0, 0, 0 ); cont_free( k2 ); idl_free( idl ); return( -1 ); @@ -461,7 +456,7 @@ idl_insert_key( case 0: /* id inserted ok */ if ( (rc = idl_store( be, db, k2, tmp )) != 0 ) { Debug( LDAP_DEBUG_ANY, - "idl_store of (%s) returns %d\n", k2.dptr, rc, 0 ); + "idl_insert_key: idl_store returned %d\n", rc, 0, 0 ); } break; @@ -494,8 +489,8 @@ idl_insert_key( cont_id( k2, ID_BLOCK_ID(idl, i) ); if ( (tmp2 = idl_fetch_one( be, db, k2 )) == NULL ) { Debug( LDAP_DEBUG_ANY, - "idl_fetch_one (%s) returns NULL\n", - k2.dptr, 0, 0 ); + "idl_insert_key: idl_fetch_one returned NULL\n", + 0, 0, 0 ); /* split the original block */ cont_free( k2 ); goto split; @@ -523,7 +518,7 @@ idl_insert_key( memcpy(k3.dptr, k2.dptr, k3.dsize); if ( (rc = idl_store( be, db, k3, tmp )) != 0 ) { Debug( LDAP_DEBUG_ANY, - "idl_store of (%s) returns %d\n", k3.dptr, rc, 0 ); + "idl_insert_key: idl_store returned %d\n", rc, 0, 0 ); } free( k3.dptr ); @@ -550,7 +545,7 @@ idl_insert_key( */ if ( rc == 2 ) { Debug( LDAP_DEBUG_ANY, - "id %ld already in next block\n", + "idl_insert_key: id %ld already in next block\n", id, 0, 0 ); } @@ -772,7 +767,7 @@ idl_delete_key ( if ( (tmp = idl_fetch_one( be, db, data )) == NULL ) { Debug( LDAP_DEBUG_ANY, - "idl_fetch of (%s) returns NULL\n", data.dptr, 0, 0 ); + "idl_delete_key: idl_fetch of returned NULL\n", 0, 0, 0 ); continue; } /* diff --git a/servers/slapd/back-ldbm/init.c b/servers/slapd/back-ldbm/init.c index 1ca9423081..5dcd6507b9 100644 --- a/servers/slapd/back-ldbm/init.c +++ b/servers/slapd/back-ldbm/init.c @@ -20,7 +20,7 @@ int back_ldbm_LTX_init_module(int argc, char *argv[]) { BackendInfo bi; - memset( &bi, 0, sizeof(bi) ); + memset( &bi, '\0', sizeof(bi) ); bi.bi_type = "ldbm"; bi.bi_init = ldbm_back_initialize; diff --git a/servers/slapd/back-passwd/init.c b/servers/slapd/back-passwd/init.c index d6bee89f8e..3e310d49e4 100644 --- a/servers/slapd/back-passwd/init.c +++ b/servers/slapd/back-passwd/init.c @@ -15,7 +15,7 @@ int back_passwd_LTX_init_module(int argc, char *argv[]) { BackendInfo bi; - memset( &bi, 0, sizeof(bi) ); + memset( &bi, '\0', sizeof(bi) ); bi.bi_type = "passwd"; bi.bi_init = passwd_back_initialize; diff --git a/servers/slapd/back-perl/init.c b/servers/slapd/back-perl/init.c index 80f366aea3..7d192b126c 100644 --- a/servers/slapd/back-perl/init.c +++ b/servers/slapd/back-perl/init.c @@ -36,7 +36,7 @@ ldap_pvt_thread_mutex_t perl_interpreter_mutex; int back_perl_LTX_init_module(int argc, char *argv[]) { BackendInfo bi; - memset( &bi, 0, sizeof(bi) ); + memset( &bi, '\0', sizeof(bi) ); bi.bi_type = "perl"; bi.bi_init = perl_back_initialize; @@ -125,7 +125,7 @@ perl_back_db_init( ) { be->be_private = (PerlBackend *) ch_malloc( sizeof(PerlBackend) ); - memset( be->be_private, 0, sizeof(PerlBackend)); + memset( be->be_private, '\0', sizeof(PerlBackend)); Debug( LDAP_DEBUG_TRACE, "perl backend db init\n", 0, 0, 0 ); diff --git a/servers/slapd/back-shell/init.c b/servers/slapd/back-shell/init.c index c539de9a1a..cb88e851f0 100644 --- a/servers/slapd/back-shell/init.c +++ b/servers/slapd/back-shell/init.c @@ -19,7 +19,7 @@ int back_shell_LTX_init_module(int argc, char *argv[]) { BackendInfo bi; - memset( &bi, 0, sizeof(bi) ); + memset( &bi, '\0', sizeof(bi) ); bi.bi_type = "shell"; bi.bi_init = shell_back_initialize; diff --git a/servers/slapd/back-sql/init.c b/servers/slapd/back-sql/init.c index 6740fcf454..efbde57a99 100644 --- a/servers/slapd/back-sql/init.c +++ b/servers/slapd/back-sql/init.c @@ -24,7 +24,7 @@ int backsql_LTX_init_module(int argc, char *argv[]) { BackendInfo bi; - memset( &bi, 0, sizeof(bi) ); + memset( &bi, '\0', sizeof(bi) ); bi.bi_type = "sql"; bi.bi_init = backbacksql_initialize; diff --git a/servers/slapd/back-tcl/tcl_init.c b/servers/slapd/back-tcl/tcl_init.c index 8acaa3c4dc..99b9f54486 100644 --- a/servers/slapd/back-tcl/tcl_init.c +++ b/servers/slapd/back-tcl/tcl_init.c @@ -25,7 +25,7 @@ ldap_pvt_thread_mutex_t tcl_interpreter_mutex; void back_tcl_LTX_init_module(int argc, char *argv[]) { BackendInfo bi; - memset( &bi, 0, sizeof(bi) ); + memset( &bi, '\0', sizeof(bi) ); bi.bi_type = "tcl"; bi.bi_init = tcl_back_initialize; diff --git a/servers/slapd/sasl.c b/servers/slapd/sasl.c index b2e40a05b8..2fd29f5073 100644 --- a/servers/slapd/sasl.c +++ b/servers/slapd/sasl.c @@ -135,7 +135,7 @@ int sasl_init( void ) #ifdef RESTRICT_SASL { sasl_security_properties_t secprops; - memset(&secprops, 0, sizeof(secprops)); + memset(&secprops, '\0', sizeof(secprops)); secprops.security_flags = SASL_SEC_NOPLAINTEXT | SASL_SEC_NOANONYMOUS; secprops.property_names = NULL; secprops.property_values = NULL; diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index a13b43a3a9..ff4d1211da 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -703,9 +703,6 @@ LIBSLAPD_F (int) slapMode; #define SLAP_MODE 0x0003 #define SLAP_TRUNCATE_MODE 0x0100 -#ifdef SLAPD_BDB2 -#define SLAP_TIMED_MODE 0x1000 -#endif /* temporary aliases */ typedef BackendDB Backend; diff --git a/servers/slurpd/st.c b/servers/slurpd/st.c index 8a76b0b181..f0addb7fa6 100644 --- a/servers/slurpd/st.c +++ b/servers/slurpd/st.c @@ -63,7 +63,7 @@ St_add( st->st_data[ ind ]->hostname = strdup( ri->ri_hostname ); st->st_data[ ind ]->port = ri->ri_port; - memset( st->st_data[ ind ]->last, 0, sizeof( st->st_data[ ind ]->last )); + memset( st->st_data[ ind ]->last, '\0', sizeof( st->st_data[ ind ]->last )); st->st_data[ ind ]->seq = 0; ldap_pvt_thread_mutex_unlock( &(st->st_mutex )); -- 2.39.5