From the strtok/strtok_r man page:
strtok
strtok_r
BUGS Avoid using these functions.
Hacked to little bits; this piece of code fits right in. Fix it later. Right.