Strtok is not thread safe and can’t be made thread safe without changing the API. You should not use it.
Well, there is already a thread-safe variant [0]: > The strtok() function uses a static buffer while parsing, so it's not thread safe. Use strtok_r() if this matters to you.
This is why it's crucial to get APIs right first time.
A function can be not thread-safe and still safe to use in single-threaded programs.
The point is that strtok is not a good choice even for single-threaded code.
Why isn't it a good choice exactly? Could you sum it up?