. . "What if the input is a string literal or a char array which has len-1 char already stuffed in so that when you access index len+1 you are stepping past the allocated memory." . .