title: C: correct usage of strtok_r
body: <p>How can I use strtok_r instead of strtok to do this?</p>
  
  <pre><code>char *pchE = strtok(NULL, " ");
  </code></pre>
  
  <p>Now I'm trying to use <code>strtok_r</code> properly... But sometimes I get problems with the <code>strtol</code>.
  I have a thread that I execute 10 times (at the same time).</p>
  
  <pre><code>char *savedEndd1;
  char *nomeClass = strtok_r(lineClasses, " ", &amp;savedEndd1);
  char *readLessonS = strtok_r (NULL, " ", &amp;savedEndd1);
  char *readNTurma = strtok_r(NULL, " ",  &amp;savedEndd1);
  
  if (readNTurma==NULL)
  printf("CLASS STRTOL begin %s %s\n",nomeClass, readLessonS );
  int numberNTurma = strtol(readNTurma, NULL, 10);
  </code></pre>
  
  <p>And I'm catching that <code>readNTurma == NULL</code> several times... Why is that? Cant understand why it comes <code>NULL</code>?</p>