Skip to content
Snippets Groups Projects
Commit 6efeab0f authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

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

parent 8a39ae85
No related branches found
No related tags found
No related merge requests found
...@@ -57,7 +57,7 @@ void Atom::map_init(int check) ...@@ -57,7 +57,7 @@ void Atom::map_init(int check)
map_nused = 0; map_nused = 0;
map_free = 0; map_free = 0;
for (int i = 0; i < map_nhash; i++) map_hash[i].next = i+1; 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 // recreating: delete old map and create new one for array or hash
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment