For those who don't know, strtok() is listed as a "don't
use this function" in most documentation because it
modifies the input string.  Horribly.  After using
strtok() the original string is no longer usable because
strtok() inserts NULL terminators into the original
string at the end of each token.  Another problem with
it is that you know neither how many nor what type of
separator was used between tokens, and there is no way
of finding out because at least one of them was replaced
by a NULL.  A useful function, but very dangerous because
the input is destroyed.


~Patrick


> > maybe it's just me, but i find this funny...
> > 
> > (from the strtok() manpage)
> > 
> > BUGS
> >        Never use this function.
> > 
> > it's a fairly big bug! :) i expect there are similar things stuck to
> > nuclear warheads (Warning! This device is hazardous to most 
> forms of life,
> > do not use).
> > 
> where is this?  It's not in my manpage.
> 

Reply via email to