diff options
author | fcolin | 2005-08-10 09:52:18 +0000 |
---|---|---|
committer | fcolin | 2005-08-10 09:52:18 +0000 |
commit | c271c5a2383450c2a39e126ebef38d8dd2e2f8e6 (patch) | |
tree | 46eaf3e4a9fc79a47bfd9e8942cef981908f304f /src/hash.c | |
parent | b0954d7461dc709cd1a43097c260c8e8b0183cee (diff) | |
download | ivy-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-x | src/hash.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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); |