From d2b500278c3ab6c93cf56df39872392fbd674c34 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Thu, 7 Jan 2021 10:10:25 -0800 Subject: [PATCH] Bug fixes --- hashset.c | 8 ++++---- include/cyclone/hashset.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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 }