The simple way to think of this is that if str isn't properly terminated, then it's not a C-style string. It's just some characters. Passing anything other than a C string to strtok is bad news, of course.
–
Steve JessopSep 2 '10 at 21:22