The function whose main selling point is that there always is a NUL-terminator ... missed the NUL-terminator.