From f880a3abdb2b9f017df27ccb8ecb8a087bf9dd9f Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Wed, 8 Aug 2012 15:13:49 +0200 Subject: [PATCH] misc: fix rehashing hashtable entries We need to hash the key instead of the whole entry, otherwise, we have dead/wrong entries in the hash-table after a rehash-round. Signed-off-by: David Herrmann --- src/static_misc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/static_misc.c b/src/static_misc.c index db49135..a6714e1 100644 --- a/src/static_misc.c +++ b/src/static_misc.c @@ -305,8 +305,9 @@ bool kmscon_direct_equal(const void *data1, const void *data2) static size_t rehash(const void *ele, void *priv) { struct kmscon_hashtable *tbl = priv; + const struct kmscon_hashentry *ent = ele; - return tbl->hash_cb(ele); + return tbl->hash_cb(ent->key); } int kmscon_hashtable_new(struct kmscon_hashtable **out,