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

Reuse pm_buffer_append function in pm_buffer_append_zeroes #2820

Closed

Conversation

S-H-GAMELINKS
Copy link
Contributor

pm_buffer_append and pm_buffer_append_zeroes functions has similar code.
May be more simpler resue pm_buffer_append function in pm_buffer_append_zeroes function.

memset(buffer->value + cursor, 0, length);
}
size_t source = 0;
pm_buffer_append(buffer, (const void *) source, length);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this is going to read off the end of source if length is greater than the number of bytes in a size_t, so I don't think we can do this here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review!
I understood.

@kddnewton kddnewton closed this May 17, 2024
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.

2 participants