Does this function guarantee that the string is zero terminated?