commit 7382abc7e554485aaa52cb8a3cdafb474473acac
parent f8e2cf9d7def06349b4726d5985123f08c3caf8d
Author: vaplv <vaplv@free.fr>
Date: Fri, 5 Sep 2014 16:24:35 +0200
Fix the erase function on empty hash table
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/hash_table.h b/src/hash_table.h
@@ -428,6 +428,8 @@ HTABLE_FUNC__(erase)(struct HTABLE__* htbl, HTABLE_KEY const* key)
pairs = HTABLE_DATA_FUNC__(data_get)(&htbl->table);
tbl_size = HTABLE_DATA_FUNC__(size_get)(&htbl->table);
+ if(!tbl_size)
+ return 0;
ASSERT(IS_POW2(tbl_size));
used_pairs = darray_char_data_get(&htbl->table_slot_is_used);