News for hackers. Stuff that matters.
Re:The abominable strtok() by tptacek on Friday September 24, 2010 @04:32PM (#1725311)
I've heard lots of dev teams gripe about strsep(3) because it "isn't standard" or "isn't cross-platform". Preposterous! strsep is a ~20 line ANSI C function; it will compile and run flawlessly on any platform that doesn't natively provide it.

I agree strongly with the other comments on this thread that strsep(3) is just peachy, even though it "alters its inputs". Unlike in functional programs, reasonable destructive functions are to be preferred in C programs; it's easier to work around destructiveness than it is to track state (and/or to go through contortions to pretend that you aren't tracking state).

There are no comments on this comment yet.