strtok function thread safety

后端 未结 2 1321
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-27 08:25

I have been spending some time in debugging a programme which gives segmentation fault. The bug is quite indeterministic and intermittent, which is annoying. I narrowed it d

2条回答
  •  时光说笑
    2020-11-27 08:54

    strtok() is not reentrant so it should not be used from threaded applications, use strtok_r() instead.

提交回复
热议问题