title: Segfault from calling strtok?
body: <p>I'm calling strtok in my function in order to get two char *s from a comma delimited char *. It's segfaulting when I do and I'm not quite sure why. </p>
  
  <pre><code>Tree tree = create_node(NULL);
  add(tree, "jacob");
  add(tree, "jacob, blue");
  </code></pre>
  
  <p>(part of) the add method:</p>
  
  <pre><code>void add(Tree tree, char * input){
      printf("Add: %s\n", input);
      char * parent_name;
      char * child_name;
      if(strstr(input, ",") != NULL){
              const char delimiter[2] = ",";
              parent_name = strtok(input, delimiter);
              child_name = strtok(NULL, delimiter);
      }else{
              parent_name = input;
      }
  
      printf("pn, %s cn: %s\n", parent_name, child_name);
  </code></pre>
  
  <p>Actual results:</p>
  
  <pre><code>Add: jacob
  pn, jacob cn: (null)
  //Empty tree!
  //jacob is the root
  Add: jacob, blue
  Segmentation fault (core dumped)
  </code></pre>
  
  <p>It segfaults on the first strtok() call. I'm really stumped as to why. Sorry if this is really basic.</p>