doc: clarify napi_get_value_string_* for bufsize 0

PR-URL: https://github.com/nodejs/node/pull/58158
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
This commit is contained in:
Tobias Nießen 2025-05-12 18:07:53 +01:00 committed by GitHub
parent 2281a04e5e
commit acb3d922cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3689,6 +3689,8 @@ napi_status napi_get_value_string_latin1(napi_env env,
is returned in `result`.
* `[in] bufsize`: Size of the destination buffer. When this value is
insufficient, the returned string is truncated and null-terminated.
If this value is zero, then the string is not returned and no changes are done
to the buffer.
* `[out] result`: Number of bytes copied into the buffer, excluding the null
terminator.
@ -3720,6 +3722,8 @@ napi_status napi_get_value_string_utf8(napi_env env,
returned in `result`.
* `[in] bufsize`: Size of the destination buffer. When this value is
insufficient, the returned string is truncated and null-terminated.
If this value is zero, then the string is not returned and no changes are done
to the buffer.
* `[out] result`: Number of bytes copied into the buffer, excluding the null
terminator.
@ -3750,6 +3754,8 @@ napi_status napi_get_value_string_utf16(napi_env env,
null terminator is returned.
* `[in] bufsize`: Size of the destination buffer. When this value is
insufficient, the returned string is truncated and null-terminated.
If this value is zero, then the string is not returned and no changes are done
to the buffer.
* `[out] result`: Number of 2-byte code units copied into the buffer, excluding
the null terminator.