c - strtok() crashing : <p>I got this problem with strtok:</p>

<pre><code>void getFile(FILE *fp, TParts *str)
{
    char a[60], *b;
    int p = 0, m = 0;
    while(fgets(a, 60, fp) != NULL)
    {
        b = strtok(a, '$');
...
</code></pre>

<p>The program crashes when strtok is called. Tokens in strings are separated with $. What's wrong?</p>
