Why length(str) != sizeof(str)?

In the wider context of the message, that sentence had the implicit meaning of: “do not use str[i] to get the i-th character of str (…)”. I thought it was clear, but nevertheless, I have edited the previous post to make it explicit.

If you are displaying it you might want textwidth