From 9e18f335b7f2db7314d8a71bf3d06704f78ad1d6 Mon Sep 17 00:00:00 2001 From: Andreas Ericsson Date: Tue, 20 Apr 2010 12:34:56 +0200 Subject: [PATCH] hash: Change order of arguments when checking hash table consistency This reverts the order, since we seem to be getting more tracked entries than counted. If table is null, we return 0. Signed-off-by: Andreas Ericsson --- hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hash.c b/hash.c index 2129ff2..8e0eb34 100644 --- a/hash.c +++ b/hash.c @@ -260,7 +260,7 @@ unsigned int hash_count_entries(hash_table *table) int hash_check_table(hash_table *table) { - return hash_count_entries(table) - table->entries; + return table ? table->entries - hash_count_entries(table) : 0; } void hash_walk_data(hash_table *table, int (*walker)(void *)) -- 2.11.4.GIT