News for hackers. Stuff that matters.
Re:The abominable strtok() by dfox on Friday September 24, 2010 @06:00PM (#1725584)
I tend to use and recommend str(c)spn, which althought more low-level are more flexible and often what you want. And also you don't have to modify input if you don't want to.
Re:The abominable strtok() by tptacek on Friday September 24, 2010 @08:43PM (#1725954)
strcspn is really, really fussy. When what you want is the semantic equivalent of "foo,bar, baz".split(','), I don't think it's worth the potential for error, or the tangliness of the code.