diff options
author | Nalin Dahyabhai <nalin@dahyabhai.net> | 2013-12-16 12:29:57 -0500 |
---|---|---|
committer | Nalin Dahyabhai <nalin@dahyabhai.net> | 2013-12-16 12:29:57 -0500 |
commit | da661ba56130fa33118d50dcda086853275898a8 (patch) | |
tree | 182d5f4ad07427b7c9f60d2eca6cb71626d5f1de /src/map.c | |
parent | ebc38099db019df7ae1f909b3af484829c9241f4 (diff) | |
download | slapi-nis-da661ba56130fa33118d50dcda086853275898a8.tar.gz slapi-nis-da661ba56130fa33118d50dcda086853275898a8.tar.xz slapi-nis-da661ba56130fa33118d50dcda086853275898a8.zip |
Removing domains and maps correctly
On domain or map removal, fill in gaps in the list of domains or maps
correctly.
Diffstat (limited to 'src/map.c')
-rw-r--r-- | src/map.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -801,8 +801,8 @@ map_data_unset_map(struct plugin_state *state, /* Close the hole in the array. */ domain->n_maps--; if (i != domain->n_maps) { - memcpy(&domain->maps[i], &domain->maps[i + 1], - sizeof(*map) * (domain->n_maps - i)); + memmove(&domain->maps[i], &domain->maps[i + 1], + sizeof(*map) * (domain->n_maps - i)); } break; } @@ -820,10 +820,10 @@ map_data_unset_map(struct plugin_state *state, /* Fill in the hole in the domains array. */ map_data.n_domains--; if (i != map_data.n_domains) { - memcpy(&map_data.domains[i], - &map_data.domains[i + 1], - sizeof(*domain) * - (map_data.n_domains - i)); + memmove(&map_data.domains[i], + &map_data.domains[i + 1], + sizeof(*domain) * + (map_data.n_domains - i)); } break; } |