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
feat(ffi): improve error buffer writing more (#331)
Builds on #276, but adds some improvements:
No longer silently truncate to ERR_BUF_MAX_LEN, errors can now be any size the caller specifies
Fixes a regression, there's no need for the error to be null terminated, and the value stored at *errbuf_len again matches the length of the actual error text, not the text plus a null terminator
Runs safely under miri
Closes#276
Commits:
* feat(ffi): improve error buf writing
* chore: make clippy happy
* chore(ffi): Improve error buffer writing more
- Take a `&mut usize` for errbuf_len, since the requirements we have for
it match the requirements for &mut
- Write directly into the provided buffer, rather than going through an
intermediate string and cstring
- Simplify doc strings - `size_of::<u8>()` is 1 by definition, and has
no alignment requirements.
* chore(docs): correct required length of `uuid_hex` parameter
* mark ERR_BUF_MAX_LEN as deprecated
---------
Co-authored-by: Shiroko <hhx.xxm@gmail.com>
0 commit comments