Skip to content

Commit 7d00fc2

Browse files
tniessenaduh95
authored andcommitted
doc: clarify napi_get_value_string_* for bufsize 0
PR-URL: #58158 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Chengzhong Wu <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent aabafbc commit 7d00fc2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

doc/api/n-api.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3683,6 +3683,8 @@ napi_status napi_get_value_string_latin1(napi_env env,
36833683
is returned in `result`.
36843684
* `[in] bufsize`: Size of the destination buffer. When this value is
36853685
insufficient, the returned string is truncated and null-terminated.
3686+
If this value is zero, then the string is not returned and no changes are done
3687+
to the buffer.
36863688
* `[out] result`: Number of bytes copied into the buffer, excluding the null
36873689
terminator.
36883690

@@ -3714,6 +3716,8 @@ napi_status napi_get_value_string_utf8(napi_env env,
37143716
returned in `result`.
37153717
* `[in] bufsize`: Size of the destination buffer. When this value is
37163718
insufficient, the returned string is truncated and null-terminated.
3719+
If this value is zero, then the string is not returned and no changes are done
3720+
to the buffer.
37173721
* `[out] result`: Number of bytes copied into the buffer, excluding the null
37183722
terminator.
37193723

@@ -3744,6 +3748,8 @@ napi_status napi_get_value_string_utf16(napi_env env,
37443748
null terminator is returned.
37453749
* `[in] bufsize`: Size of the destination buffer. When this value is
37463750
insufficient, the returned string is truncated and null-terminated.
3751+
If this value is zero, then the string is not returned and no changes are done
3752+
to the buffer.
37473753
* `[out] result`: Number of 2-byte code units copied into the buffer, excluding
37483754
the null terminator.
37493755

0 commit comments

Comments
 (0)