Hacker News new | ask | show | jobs
by morbusfonticuli 2738 days ago
> 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.

[0] https://linux.die.net/man/3/strtok_r

1 comments

...with different API :P
of course! the original API cannot be made re-entrant