mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-11 23:03:21 -05:00
Replace bubble move with SAFEMEMCPY
This commit is contained in:
parent
5ecf77c034
commit
120534222c
1 changed files with 4 additions and 4 deletions
|
|
@ -644,10 +644,10 @@ bdb2i_idl_insert( ID_BLOCK **idl, ID id, unsigned int maxids )
|
|||
(ID_BLOCK_NMAX(*idl) + ID_BLOCK_IDS_OFFSET) * sizeof(ID) );
|
||||
}
|
||||
|
||||
/* make a slot for the new id *//* XXX bubble move XXX */
|
||||
for ( j = ID_BLOCK_NIDS(*idl); j != i; j-- ) {
|
||||
ID_BLOCK_ID(*idl, j) = ID_BLOCK_ID(*idl, j-1);
|
||||
}
|
||||
/* make a slot for the new id */
|
||||
SAFEMEMCPY( &ID_BLOCK_ID(*idl, i), &ID_BLOCK_ID(*idl, i+1),
|
||||
ID_BLOCKS_NIDS(*idl) - i );
|
||||
|
||||
ID_BLOCK_ID(*idl, i) = id;
|
||||
ID_BLOCK_NIDS(*idl)++;
|
||||
(void) memset(
|
||||
|
|
|
|||
Loading…
Reference in a new issue