diff -r 8f7d3e7b5b93 -r fd3d843b839d src/hash_map.c --- a/src/hash_map.c Fri May 27 11:39:50 2022 +0200 +++ b/src/hash_map.c Fri May 27 12:28:35 2022 +0200 @@ -335,13 +335,14 @@ if (map->size > 0) { struct cx_hash_map_s *hash_map = (struct cx_hash_map_s *) map; - struct cx_hash_map_element_s *elem = NULL; - for (; elem == NULL; iter.slot++) { - elem = hash_map->buckets[iter.slot]; + struct cx_hash_map_element_s *elm = NULL; + for (; elm == NULL; iter.slot++) { + elm = hash_map->buckets[iter.slot]; } - iter.elem_handle = elem; - iter.kv_data.key = NULL; - iter.kv_data.value = NULL; + iter.elem_handle = elm; + iter.kv_data.key = &elm->key; + // TODO: pointer to data if this map is storing copies + iter.kv_data.value = elm->data; } else { iter.elem_handle = NULL; iter.kv_data.key = NULL;