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 order of calloc() args #639

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix order of calloc() args #639

wants to merge 1 commit into from

Conversation

gperciva
Copy link
Member

No description provided.

Most of these were done upstream in:
    2023-10-18 Use calloc arguments that correspond with the...
    libarchive 2edd8819501023bc909869b7b652b55edfa7342e
Note that libarchive renamed archive_read_support_compression_* to
archive_read_support_filter_*.

The remaining two cases of fixed "calloc(sizeof" were in code which had
been deleted upstream.

Reported by:	gcc-15
@@ -183,7 +183,7 @@ bzip2_reader_init(struct archive_read_filter *self)
self->code = ARCHIVE_COMPRESSION_BZIP2;
self->name = "bzip2";

state = (struct private_data *)calloc(sizeof(*state), 1);
state = (struct private_data *)calloc(1, sizeof(*state));
Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, that cast is a silly C++ism, but the commit I mentioned only fixed the order of calloc, so I left the cast unchanged.

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

Successfully merging this pull request may close these issues.

1 participant