Fix own error w/ undefined behavior

This happened to work for me but caused issues on OSX.
This commit is contained in:
Campbell Barton 2016-06-13 21:55:54 +10:00
parent 2566652ae6
commit f2c5ea2516
1 changed files with 4 additions and 2 deletions

View File

@ -88,8 +88,10 @@ struct IDNameLib_Map *BKE_main_idmap_create(struct Main *bmain)
int index = 0;
while (index < MAX_LIBARRAY) {
id_map->type_maps[index].map = NULL;
id_map->type_maps[index].id_type = BKE_idcode_iter_step(&index);
struct IDNameLib_TypeMap *type_map = &id_map->type_maps[index];
type_map->map = NULL;
type_map->id_type = BKE_idcode_iter_step(&index);
BLI_assert(type_map->id_type != 0);
}
BLI_assert(index == MAX_LIBARRAY);