summaryrefslogtreecommitdiff
path: root/src/hash.c
diff options
context:
space:
mode:
authorfcolin2005-08-10 09:52:18 +0000
committerfcolin2005-08-10 09:52:18 +0000
commitc271c5a2383450c2a39e126ebef38d8dd2e2f8e6 (patch)
tree46eaf3e4a9fc79a47bfd9e8942cef981908f304f /src/hash.c
parentb0954d7461dc709cd1a43097c260c8e8b0183cee (diff)
downloadivy-c-c271c5a2383450c2a39e126ebef38d8dd2e2f8e6.zip
ivy-c-c271c5a2383450c2a39e126ebef38d8dd2e2f8e6.tar.gz
ivy-c-c271c5a2383450c2a39e126ebef38d8dd2e2f8e6.tar.bz2
ivy-c-c271c5a2383450c2a39e126ebef38d8dd2e2f8e6.tar.xz
remplacement argc argv par IvyArgument
Diffstat (limited to 'src/hash.c')
-rwxr-xr-xsrc/hash.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/hash.c b/src/hash.c
index 50a9acd..a8076ae 100755
--- a/src/hash.c
+++ b/src/hash.c
@@ -132,6 +132,7 @@ HASHTABLE hash_create(unsigned long InitialSize, BOOL KeyIsString)
// Allocate space for the hash table.
table = malloc(sizeof(*table));
+ memset( table, 0, sizeof(*table) );
// Minimum size of hash table is 8.
if (InitialSize < 8 )
@@ -147,6 +148,8 @@ HASHTABLE hash_create(unsigned long InitialSize, BOOL KeyIsString)
table->Rows = malloc(InitialSize * sizeof(struct ROW));
table->KeyIsString = KeyIsString;
+ memset( table->Rows, 0, InitialSize * sizeof(struct ROW) );
+
return table;
@@ -465,6 +468,7 @@ extern void hash_usage(void)
// Create some data to store
p = malloc(sizeof(*p));
+ memset ( p, 0 ,sizeof( *p));
p->ID = NumberKey;
p->Age = 20;
sprintf(p->Name, StringKey);
@@ -608,6 +612,8 @@ extern BOOL hash_test(void)
printf("HASH strings Tests for %d items\n", max);
table = hash_create(max, TRUE);
s = malloc(sizeof(*s) * max);
+ memset ( s, 0 ,sizeof( *s)*max);
+
for (i = 0; i < max; i++)
{
sprintf(temp, "Item %d", i);