<div class="gmail_quote"><div dir="ltr"><span style="color:rgb(33,33,33);font-size:13px">>This is not thread-safe.</span></div><div class="gmail_forwarded"><div dir="ltr"><span style="color:rgb(33,33,33);font-size:13px">>--</span><br style="color:rgb(33,33,33);font-size:13px"><span style="color:rgb(33,33,33);font-size:13px">>Rémi Denis-Courmont</span><br><div><span style="color:rgb(33,33,33);font-size:13px"><br></span></div><div><span style="color:rgb(33,33,33);font-size:13px">If I was calling strtok multiple times for a single string with NULL passed in for subsequent calls so that strtok maintains a internal buffer, it would have been thread unsafe, in which case I would have used strtok_r. </span></div><div><span style="color:rgb(33,33,33);font-size:13px">But since I'm calling strtok only once to get the very first token there is not need to maintain an internal buffer for use by strtok and hence eliminates the very cause of it not being thread safe.</span></div><div><span style="color:rgb(33,33,33);font-size:13px"><br></span></div><div><span style="color:rgb(33,33,33);font-size:13px">Regards</span></div><div><span style="color:rgb(33,33,33);font-size:13px">Shaleen Jain</span></div></div></div></div>