The GNU libc functions strtok() and strok_r() seem to be rather unsafe to use, so I wrote this replacement. It is not superfast (memory allocations to hold tokens), but will not mess up a threaded application, give you a whole bunch of valid tokens immediately, and is portable.
MingW32 seems to be missing strtok_r(), among other things. And the big fat warnings put me off using the strtok-family too much, anyway. I quote the BUGS section: "Never use these functions".