You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add optional length to functions accepting const char * #254
As discussed in the last meeting, zero-terminated const char*, while popular in C land, might be problematic for consumers in other languages having different string representation (for example, Rust with non-zero-terminated string slices represented as data + length).
Some N-API functions already accept optional length that, when set to -1, would mean a length calculated from zero-terminated string and explicit byte length otherwise.
It's worth to go through a list of functions that accept const char* and add length parameter where it's missing, especially for functions that don't provide variants with napi_value as a string, namely:
Thanks @RReverser - moved discussion to nodejs/node#15108 since this is a nice to have and we'll get more help and visibility on the main repo. Closing this one
Activity
digitalinfinity commentedon Aug 31, 2017
Thanks @RReverser - moved discussion to nodejs/node#15108 since this is a nice to have and we'll get more help and visibility on the main repo. Closing this one