Fix pblock_delete_param(), this function never worked

This commit is contained in:
Luke Howard 2005-07-25 05:38:31 +00:00
parent 43ec05a45a
commit bb04c4eb9d
2 changed files with 4 additions and 4 deletions

View File

@ -108,7 +108,6 @@ typedef enum slapi_pblock_class_e {
struct slapi_pblock {
ldap_pvt_thread_mutex_t pblockMutex;
int ckParams;
int numParams;
int curParams[PBLOCK_MAX_PARAMS];
void *curVals[PBLOCK_MAX_PARAMS];

View File

@ -1147,9 +1147,11 @@ pblock_delete_param( Slapi_PBlock *p, int param )
pblock_unlock( p );
return PBLOCK_ERROR;
}
/* move last parameter to index of deleted parameter */
if ( p->numParams > 1 ) {
p->curParams[i] = p->curParams[p->numParams];
p->curVals[i] = p->curVals[p->numParams];
p->curParams[i] = p->curParams[p->numParams - 1];
p->curVals[i] = p->curVals[p->numParams - 1];
}
p->numParams--;
@ -1165,7 +1167,6 @@ slapi_pblock_new(void)
pb = (Slapi_PBlock *) ch_calloc( 1, sizeof(Slapi_PBlock) );
if ( pb != NULL ) {
pb->ckParams = 1;
ldap_pvt_thread_mutex_init( &pb->pblockMutex );
memset( pb->curParams, 0, sizeof(pb->curParams) );
memset( pb->curVals, 0, sizeof(pb->curVals) );