News for hackers. Stuff that matters.
Re:The abominable strtok() by __david__ on Friday September 24, 2010 @08:19PM (#1725904)
What are you talking about? There is no sizeof(dest) with strndup()--it's newly allocated memory sized appropriately so there's no chance of an overwrite.
Re:The abominable strtok() by tptacek on Friday September 24, 2010 @08:44PM (#1725956)
While we're on the subject, what is the point of strndup()? Keeping people from running you out of memory with big long strings? They'll just find other ways to do the same thing (by repeatedly feeding you strings of threshold length).
Re:The abominable strtok() by CamperBob on Friday September 24, 2010 @11:44PM (#1726230)
(Actually it was strncpy's wacky behavior I was thinking of. I don't think I've ever used strndup().)