Re-entrancy in DLLs
Posted on 1997-04-28
I am inserting a strtok function into a 16 bit DLL. strtok
accepts 2 arguments - argument 1 - the string in which the
token is to be found, and argument 2 the token itself.
However strtok can be called again and again to find multiple instances of the token in the same string - by
calling it with the 1st argument set to NULL.
I am facing problems w.r.t the above aspect i.e. looking
for the same token in the same string. If more than 1
application calls strtok and uses the above feature
and since I am using a "static char" variable to store
the original string - this feature gives erroneous results.
Any pointers will be greatly appreciated.