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' :
* 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
return( fmterr );
}
- memset( (char *)&t, 0, sizeof( struct tm ));
+ memset( (char *)&t, '\0', sizeof( struct tm ));
p = ldtimestr;
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)
(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);
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);
* Print stuff
*/
static void
-ber_error_print( char *data )
+ber_error_print( const char *data )
{
assert( data != NULL );
assert( data != NULL );
- memset( out, 0, BPLEN );
+ memset( out, '\0', BPLEN );
for ( ;; ) {
if ( len < 1 ) {
sprintf( buf, "\t%s\n", ( i == 0 ) ? "(end)" : out );
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;
}
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;
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);
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 );
}
*res = NULL;
- (void) memset( &cri, 0, sizeof( cri ));
+ (void) memset( &cri, '\0', sizeof( cri ));
if ( logdn != NULL ) {
ld->ld_cldapdn = logdn;
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;
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 );
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 );
}
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;
return( fmterr );
}
- memset( (char *)&t, 0, sizeof( struct tm ));
+ memset( (char *)&t, '\0', sizeof( struct tm ));
p = ldtimestr;
{
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 );
{
if ( data.dptr ) {
free( data.dptr );
- memset( &data, 0, sizeof( Datum ));
+ memset( &data, '\0', sizeof( Datum ));
data.dptr = NULL;
}
}
#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
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;
}
* 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);
/*
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;
}
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;
}
* 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);
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;
}
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;
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;
/* 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 */
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
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 );
}
ACL_INIT(mask);
- memset(matches, 0, sizeof(matches));
+ memset(matches, '\0', sizeof(matches));
control = ACL_BREAK;
a = NULL;
break;
}
- memset(matches, 0, sizeof(matches));
+ memset(matches, '\0', sizeof(matches));
}
if ( ACL_IS_INVALID( mask ) ) {
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;
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;
#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 '@'
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);
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;
}
/* 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 );
}
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 );
}
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 );
}
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 );
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 );
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;
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;
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 );
*/
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 );
}
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;
}
/*
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;
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;
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;
)
{
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 );
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;
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;
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;
#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;
#define SLAP_MODE 0x0003
#define SLAP_TRUNCATE_MODE 0x0100
-#ifdef SLAPD_BDB2
-#define SLAP_TIMED_MODE 0x1000
-#endif
/* temporary aliases */
typedef BackendDB Backend;
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 ));