diff --git a/hashset.c b/hashset.c index b6ac8d9c..dedecfd6 100644 --- a/hashset.c +++ b/hashset.c @@ -144,12 +144,12 @@ int hashset_is_member(hashset_t set, void *item) return 0; } -void hashset_to_array(hashset_t set, void *items) +void hashset_to_array(hashset_t set, void **items) { - for (unsigned int hs = 0, a = 0; hs ; set->capacity; hs++) { - size_t value = (size_t)item; + for (unsigned int hs = 0, a = 0; hs < set->capacity; hs++) { + size_t value = (size_t)set->items[hs]; if (value != 0 && value != 1) { - items[a] = set->items[hs]; + items[a] = (void *)value; a++; } } diff --git a/include/cyclone/hashset.h b/include/cyclone/hashset.h index 28787ace..a1244a47 100644 --- a/include/cyclone/hashset.h +++ b/include/cyclone/hashset.h @@ -66,7 +66,7 @@ extern "C" { */ int hashset_is_member(hashset_t set, void *item); - void hashset_to_array(hashset_t set, void *items); + void hashset_to_array(hashset_t set, void **items); #ifdef __cplusplus }