Describe the bug
The write family of functions documents the result as:
The string is encoded as UTF-8 with a null-terminator.
and the len argument as:
The len is a pointer to receive output length, pass NULL if you don't need it.
but it is not clear if the null-terminator is included in the length. One might assume it's like strlen() and does not include the null-terminator. One might also assume it's the number of bytes written, which is +1, and get it wrong.
Additional context
This suggestion is obviously a very minor clarification. A small addition to the docs, such as "not including terminator", could avoid writing test code to determine behavior and avoid the string equivalent of an off-by-one error.
Describe the bug The write family of functions documents the result as:
and the
len
argument as:but it is not clear if the null-terminator is included in the length. One might assume it's like
strlen()
and does not include the null-terminator. One might also assume it's the number of bytes written, which is +1, and get it wrong.Additional context This suggestion is obviously a very minor clarification. A small addition to the docs, such as "not including terminator", could avoid writing test code to determine behavior and avoid the string equivalent of an off-by-one error.