Skip to content
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

Incorrect length & capacity calculation in ByteBuffer::destroy_into_vec_struct #93

Open
Grimeh opened this issue Sep 29, 2024 · 0 comments

Comments

@Grimeh
Copy link

Grimeh commented Sep 29, 2024

ByteBuffer::destroy_into_vec_struct multiplies the length & capacity of the byte buffer by the size of the struct, however it should divide by the size to go from number of bytes to number of elements.

let length = (self.length * element_size) as usize;
let capacity = (self.capacity * element_size) as usize;

csbindgen/README.md

Lines 956 to 957 in 768761c

let length = (self.length * element_size) as usize;
let capacity = (self.capacity * element_size) as usize;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant