avoid segfault when using a hash as map on an empty system

This commit is contained in:
Axel Kohlmeyer 2018-02-10 20:40:02 +01:00
parent 8a39ae8585
commit 6efeab0f3a
1 changed files with 1 additions and 1 deletions

View File

@ -57,7 +57,7 @@ void Atom::map_init(int check)
map_nused = 0;
map_free = 0;
for (int i = 0; i < map_nhash; i++) map_hash[i].next = i+1;
map_hash[map_nhash-1].next = -1;
if (map_nhash > 0) map_hash[map_nhash-1].next = -1;
}
// recreating: delete old map and create new one for array or hash