the comment could be worded more clearly (i think i wrote it in the firstplace, but it's not that clear).

the gist of it is, if the 'len' parameter is less than 0, then the length of the string is the position of the first null byte.