title: Issue with Inserting Token into Hashtable
body: <p>I'm putting together a program to parse through large text files, count how many times each word appears and then use that data to perform other calculations and comparisons. At the moment, I'm encountering an issue related to an interactions between my hashTable insert() method and the tokens I am using the collect words.</p>
  
  <p>I've attempted to narrow down where the error is occurring but I must have overlooked something because I can't seem to locate the exact position.</p>
  
  <p>Below is the code for the insert method:</p>
  
  <pre><code>void insert(struct table * t, char *key)
  {
      int pos = hashCode(t,key);
      struct node *list = t-&gt;list[pos];
      struct node *newNode = (struct node*)malloc(sizeof(struct node));
      struct node *temp = list;
      while(temp != NULL)
      {
          if(strcmp(temp-&gt;key, key) == 0)
          {
  
              temp-&gt;count+=1;
                               printf("Match found, count incremented");
              return;
          }
          temp = temp-&gt;next;
      }
      newNode-&gt;key = key;
      newNode-&gt;count = 1;
      newNode-&gt;next = list;
      t-&gt;list[pos] = newNode;
      return;
  }
  </code></pre>
  
  <p>The method should create a hash code for the word passed to the function, then if the hash code already exists, iterate through the linked list there and if it finds an exact match, increase the count of that word. Otherwise, it creates a new node and adds it to the hash table.
  And here is the relevant code for the method I am using to parse through the file, at this stage of development I am only looking to ignore white space characters for delim:</p>
  
  <pre><code>    char delim[] = " \t\r\n\v\f";
      while((nread = getline(&amp;line, &amp;len, fp)) != -1) {
  
          char * token = strtok(line, delim);
              printf("line grabbed. %s\n", filename);
          while(token != NULL) {
                  printf("Tok: %s\n", token);
              insert(t, token);
                  printf("Inserted: %s Count: %d\n", lookup(t, token)-&gt;key, lookup(t, token)-&gt;count);
              token = strtok(NULL, delim);
          }
      }
  </code></pre>
  
  <p>The error occurs after the insert method is called for a duplicate token (i.e. the 2nd instance of 'word' in the file. The insert statement is called, and it successfully recognizes it as a duplicate and increments, but does not continue through the code to the next print statement (the inserted statement).</p>
  
  <p>Output appears like this:</p>
  
  <pre><code>Table created, attempting to fill.
  line grabbed. t2.txt
  Tok: word
  Inserted: word Count: 1
  Tok: word
  Match found, count incremented
  </code></pre>
  
  <p>Can anyone provide insight into where I've gone wrong in my implementation?</p>
  
  <p>EDIT: input file is</p>
  
  <pre><code>word word   word
  word 
  
  
  </code></pre>