← cproj

source

bcf5597c6acb2e1b08f6d4f16ce9e2672f0283b2 · Ovidiu · Aug 27, 2019 15:08

+8 −2 · 1 file changed

  • mylib/src/myhash.c +8 −2
diff --git a/mylib/src/myhash.c b/mylib/src/myhash.c
index cd299ef..ecd7fd2 100644
--- a/mylib/src/myhash.c
+++ b/mylib/src/myhash.c
@@ -118,16 +118,22 @@ HashTable *h_resize (HashTable *oldHashTable, unsigned int size) {
 		oldNode = *hNodePtr;
 		// Check first if node is not null
 			while (oldNode != NULL) {
+				fprintf(stderr,"OldNode is not null, it is %s",oldNode->h_value);
+				HashNode* tempVar = oldNode->h_next;
+					if (tempVar == NULL) {
+						fprintf(stderr,"tempVar is null, skipping\n");
+						break;
+					}
+
 			// Transfer from old table to new table
 			// oldnode is not not null
 			// 1. grab  next pointer before move put it in a temp variable hashnode*
 			// 2. move node to new hash table - find index, rehash key , etc
 			// 3. oldnode = temp variable
-					
+		}
 	} while (++hNodePtr < hNodePtrZ);
 	// free old array
 
-
 	return biggerHashTable;
 }