[PATCH 07/15] hash.c: rearrange xcalloc arguments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



xcalloc takes two arguments: the number of elements and their size.
grow_hash_table passes the arguments in reverse order, passing the
size of a hash table entry, followed by the number of entries.
Rearrgange them so they are in the correct order.

Signed-off-by: Brian Gesiak <modocache@xxxxxxxxx>
---
 hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hash.c b/hash.c
index 749ecfe..2067be9 100644
--- a/hash.c
+++ b/hash.c
@@ -53,7 +53,7 @@ static void grow_hash_table(struct hash_table *table)
 	struct hash_table_entry *old_array = table->array, *new_array;
 
 	new_size = alloc_nr(old_size);
-	new_array = xcalloc(sizeof(struct hash_table_entry), new_size);
+	new_array = xcalloc(new_size, sizeof(struct hash_table_entry));
 	table->size = new_size;
 	table->array = new_array;
 	table->nr = 0;
-- 
2.0.0.rc1.543.gc8042da

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]