diff options
author | Matt Strapp <strap012@umn.edu> | 2020-10-05 09:43:40 -0500 |
---|---|---|
committer | Matt Strapp <strap012@umn.edu> | 2020-10-05 09:43:40 -0500 |
commit | df5ab3ea3825fbaf287ca8481bdddb35cdd9b32f (patch) | |
tree | 9c2b3af3aba63f64791ea827f9d3109903ec41d2 | |
parent | Fix typo (diff) | |
download | csci4061-df5ab3ea3825fbaf287ca8481bdddb35cdd9b32f.tar csci4061-df5ab3ea3825fbaf287ca8481bdddb35cdd9b32f.tar.gz csci4061-df5ab3ea3825fbaf287ca8481bdddb35cdd9b32f.tar.bz2 csci4061-df5ab3ea3825fbaf287ca8481bdddb35cdd9b32f.tar.lz csci4061-df5ab3ea3825fbaf287ca8481bdddb35cdd9b32f.tar.xz csci4061-df5ab3ea3825fbaf287ca8481bdddb35cdd9b32f.tar.zst csci4061-df5ab3ea3825fbaf287ca8481bdddb35cdd9b32f.zip |
Fix spacing & add a comment
-rw-r--r-- | P1/src/mapper.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/P1/src/mapper.c b/P1/src/mapper.c index f234859..0fd6198 100644 --- a/P1/src/mapper.c +++ b/P1/src/mapper.c @@ -23,14 +23,14 @@ valueList *insertNewValueToList(valueList *root, char *count){ // free value list void freeValueList(valueList *root) { -if(root == NULL) return; + if(root == NULL) return; -valueList *tempNode = NULL; -while (root != NULL){ -tempNode = root; -root = root -> next; -free(tempNode); -} + valueList *tempNode = NULL; + while (root != NULL){ + tempNode = root; + root = root -> next; + free(tempNode); + } } // create <word, value list> @@ -73,6 +73,8 @@ void freeInterDS(intermediateDS *root) { tempNode = root; root = root -> next; freeValueList(tempNode -> value); + //THIS FREE BREAKS ONCE PER PROCESS + //WILL PROBABLY BE FIXED IF THE EMPTY FILES PROBLEM GETS FIXED free(tempNode); } } |