-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: fix return results description of napi_get_value_string_utf8 #14529
Conversation
doc/api/n-api.md
Outdated
terminator. If the buffer size is insufficient, the string will be truncated | ||
including a null terminator. | ||
- `[out] result`: Number of bytes copied into the buffer, excluding the null | ||
terminator. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the buffer size is insufficient, the string will be truncated including a null terminator.
I feel like this information should be represented somewhere, maybe as part of the bufsize parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, yes! do you feel it may be best to keep this sentence within the [out] result
description?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to move that sentence to be part of the [in] bufsize
parameter comment. That's where it's relevant to call out that the string will be truncated, but still include a null terminator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's good to call out the possible truncation for inadequate buffer sizes. I don't think it belongs where it was though.
doc/api/n-api.md
Outdated
- `[out] result`: Number of bytes copied into the buffer including the null. | ||
terminator. If the buffer size is insufficient, the string will be truncated | ||
including a null terminator. | ||
- `[in] bufsize`: Size of the destination buffer. When this value is insufficient, the returned string will be truncated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kfarnung I added the details about the string truncation, but now under the bufsize
line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: needs a line wrap at 80 chars :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doh, pushed a fix 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@taveras seems like there are now conflicts, can you rebase ? |
@mhdawson i rebased the branch against master. also, i added the same changes for the remaining |
@taveras thanks :) CI run: https://ci.nodejs.org/job/node-test-pull-request/9792/ |
CI failure was unrelated, opened #14982 |
Landing, sorry it took so long. |
The API for napi_get_value_string_utf8() appears to have been previously changed. This improves the doc reflect the current design. PR-URL: #14529 Fixes: #14398 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
The API for napi_get_value_string_utf8() appears to have been previously changed. This improves the doc reflect the current design. PR-URL: nodejs/node#14529 Fixes: nodejs/node#14398 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
The API for napi_get_value_string_utf8() appears to have been previously changed. This improves the doc reflect the current design. PR-URL: nodejs/node#14529 Fixes: nodejs/node#14398 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
The API for napi_get_value_string_utf8() appears to have been previously changed. This improves the doc reflect the current design. PR-URL: #14529 Fixes: #14398 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
The API for napi_get_value_string_utf8() appears to have been previously changed. This improves the doc reflect the current design. PR-URL: #14529 Fixes: #14398 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
The API for napi_get_value_string_utf8() appears to have been previously changed. This improves the doc reflect the current design. PR-URL: nodejs#14529 Fixes: nodejs#14398 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
The API for napi_get_value_string_utf8() appears to have been previously changed. This improves the doc reflect the current design. Backport-PR-URL: #19447 PR-URL: #14529 Fixes: #14398 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
The API for napi_get_value_string_utf8() appears to have been
previously changed. This improves the doc reflect the current design.
Fixes: #14398
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
doc, n-api