top | item 18688060

(no title)

morbusfonticuli | 7 years 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

discuss

order

seba_dos1|7 years ago

...with different API :P

enriquto|7 years ago

of course! the original API cannot be made re-entrant