Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: string terminology

Wide characters will contain null bytes if taken from the ASCII character set. As a result, using narrow character functions that rely on null-byte termination can lead to obtuse unexpected behavior. Likewise, a narrow character string that is properly null-terminated string  might not be considered so in null-terminated by a wide character function. Improper use of narrow and wide character strings could result in buffer overflows or data truncation.

...

The strlen() function counts the number of characters in a null-terminated byte string preceding the terminating null byte. However, wide characters can contain null bytes, particularly when taken from the ASCII character set, as in this example. As a result, the strlen() function will return the number of bytes preceding the first null byte in the string. 

...