Use of strtok() in dpdk code
Isaac Boukris
iboukris at gmail.com
Mon Oct 21 20:30:02 CEST 2024
Hello,
I was debugging a crash resulting from strtok() returning NULL
unexpectedly (string still had tokens and delimiters), and the only
explanation I could come up with was that strtok is thread-unsafe and
another thread could have been calling it at the same time, and so I
changed it to use strtok_r().
That said, the only other possible use of strtok() that I could find
was in the dpdk code (telemetry), which brings me to my question,
should we consider changing all occurrences to strtok_r() or am I
missing something? there seem to be quite some in non-initialization
code.
Thanks!
More information about the dev
mailing list