Remove strtok, it's not reentrant and should not be used in threaded programs.