When i'm not calling the same function in my code everything works well but when the function returns from a recursion suddenly the variable pch
is NULL:
void someFunction()
{
char * pch;
char tempDependencies[100*64+100];
strcpy(tempDependencies,map[j].filesNeeded);
pch = strtok(tempDependencies,",");
while (pch != NULL)
{
someFunction(); <- if i comment this out it works fine
pch = strtok (NULL, ",");
}
}
So for instance when the loop acts on the string file2,file3,file4
it correctly split file2
and modifies the string to file2\\000file3,file4
but the next call to pch = strtok (NULL, ",");
renders pch
to be 0x0
. Are there things that i'm not aware of when calling recursion?