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

Fix issue with cbits_resize overwriting data when shrinking #94

Merged
merged 1 commit into from
Sep 23, 2024

Conversation

thehoustonian
Copy link

Fixes #93

This pull request addresses an issue where cbits_resize() could overwrite the existing data stored in a buffer entry if the cbits object is resized down from a buffer entry-aligned size (such as 64, 128, etc), to one that is not aligned (such as 50 or 100).

I'm not sure if this is the best approach, but it does appear to fix the issue for me. Let me know if there's anything else I need to do, or if this is not an acceptable fix.

@tylov tylov merged commit aae90f4 into stclib:master Sep 23, 2024
@tylov
Copy link
Collaborator

tylov commented Sep 23, 2024

Sorry for my slow response. Thanks! I haven't actually tested it, but it seems 100% correct that this block should only run when resizing down. Accepted.

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

Successfully merging this pull request may close these issues.

cbits_resize resets the contents of existing element when shrinking
2 participants