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
as_buf passes to the callback the length of the string + 1 for the null character. Now that it as_buf also accepts slices this results in some very confusing behavior (#3365).
I suggest we remove the len parameter completely. Users that care about the length should capture it and not assume anything about null termination (as_c_str is for null termination).
The text was updated successfully, but these errors were encountered:
This PR fixes#7235 and #3371, which removes trailing nulls from `str` types. Instead, it replaces the creation of c strings with a new type, `std::c_str::CString`, which wraps a malloced byte array, and respects:
* No interior nulls
* Ends with a trailing null
as_buf
passes to the callback the length of the string + 1 for the null character. Now that itas_buf
also accepts slices this results in some very confusing behavior (#3365).I suggest we remove the
len
parameter completely. Users that care about the length should capture it and not assume anything about null termination (as_c_str is
for null termination).The text was updated successfully, but these errors were encountered: