version 1.39, 2000/11/12 19:50:38 |
version 1.40, 2000/11/14 23:48:55 |
|
|
/* |
/* |
* We have this key. Free the old key. Since we |
* We have this key. Free the old key. Since we |
* don\'t want to leave empty slots in the middle of |
* don\'t want to leave empty slots in the middle of |
* the array, we actually free the key there and copy |
* the array, we actually free the key there and move |
* data from the last entry. |
* all the entries between the empty slot and the end |
|
* of the array. |
*/ |
*/ |
Idtab *tab = idtab_lookup(version); |
Idtab *tab = idtab_lookup(version); |
key_free(tab->identities[idx].key); |
key_free(tab->identities[idx].key); |
|
|
fatal("process_remove_identity: " |
fatal("process_remove_identity: " |
"internal error: tab->nentries %d", |
"internal error: tab->nentries %d", |
tab->nentries); |
tab->nentries); |
if (idx != tab->nentries - 1) |
if (idx != tab->nentries - 1) { |
tab->identities[idx] = tab->identities[tab->nentries - 1]; |
int i; |
|
for (i = idx; i < tab->nentries - 1; i++) |
|
tab->identities[i] = tab->identities[i+1]; |
|
} |
|
tab->identities[tab->nentries - 1].key = NULL; |
|
tab->identities[tab->nentries - 1].comment = NULL; |
tab->nentries--; |
tab->nentries--; |
success = 1; |
success = 1; |
} |
} |