title: Checking delimiter on strtok for empty node values
body: <p>So I have to write a linked list to file and then read the values into a new list, the problem I seem to be having is when I'm using strtok and trying to pass in an empty node such as &quot;&quot;. I have delimiters, labelled &quot;z&quot; for testing right now and I know when strtok sees two delimiters next to each other, it completely skips over until it can find another value.</p>
  <p>My question would be, is there a way to manually check when two delimiters are next to each other and then add an empty node to my list or is there a much simple solution to this exercise ?</p>
  <pre><code>typedef struct NODE {
  
  char * value;
    struct NODE * next;
  }
  Node;
  
  typedef Node ** List;
  
  
  int saving_list(List list, char * fileName) {
  
    FILE * fptr;
    fptr = fopen(fileName, &quot;w&quot;);
    char * s = &quot;z&quot;;
    //char * t = &quot;3&quot;;
  
    Node * list1 = * list;
    int count = 0;
  
    if (fptr == NULL) {
      return -1;
    }
  
    
    while (list1 != NULL) {
     // fputs( list1 -&gt; value, fptr);
      //fputs(s, fptr);
      
      fputs(list1-&gt;value, fptr);
      fputs(s, fptr);
      list1 = list1 -&gt; next;
      count++;
    }
  
   
  
    fclose(fptr);
    return count;
  }
  
  
  List loading_list(char * fileName) {
  
    List list = new_list();
  
    FILE * fptr;
    char buff[255];
    char * s = &quot;z&quot;;
    char * token;
  
    fptr = fopen(fileName, &quot;r&quot;);
  
    if (fptr == NULL) {
      return NULL;
    }
  
    fgets(buff, 255, (FILE * ) fptr);
    token = strtok(buff, s);
    //token = strsep (&amp;buff, s);
  
    while (token != NULL) {
  
      char * result = malloc(sizeof(buff));
      strcpy(result, token);
      push(list,result);
      token = strtok(NULL, s);
  
        }
    fclose(fptr);
    return list;
  }
  }
  </code></pre>