self->code = ARCHIVE_FILTER_BZIP2;
self->name = "bzip2";
- state = (struct private_data *)calloc(sizeof(*state), 1);
+ state = (struct private_data *)calloc(1, sizeof(*state));
out_block = (unsigned char *)malloc(out_block_size);
if (state == NULL || out_block == NULL) {
archive_set_error(&self->archive->archive, ENOMEM,
self->code = ARCHIVE_FILTER_COMPRESS;
self->name = "compress (.Z)";
- state = (struct private_data *)calloc(sizeof(*state), 1);
+ state = (struct private_data *)calloc(1, sizeof(*state));
out_block = malloc(out_block_size);
if (state == NULL || out_block == NULL) {
free(out_block);
self->code = ARCHIVE_FILTER_GZIP;
self->name = "gzip";
- state = (struct private_data *)calloc(sizeof(*state), 1);
+ state = (struct private_data *)calloc(1, sizeof(*state));
out_block = (unsigned char *)malloc(out_block_size);
if (state == NULL || out_block == NULL) {
free(out_block);
self->code = ARCHIVE_FILTER_LZ4;
self->name = "lz4";
- state = (struct private_data *)calloc(sizeof(*state), 1);
+ state = (struct private_data *)calloc(1, sizeof(*state));
if (state == NULL) {
archive_set_error(&self->archive->archive, ENOMEM,
"Can't allocate data for lz4 decompression");
self->code = ARCHIVE_FILTER_LZOP;
self->name = "lzop";
- state = (struct read_lzop *)calloc(sizeof(*state), 1);
+ state = (struct read_lzop *)calloc(1, sizeof(*state));
if (state == NULL) {
archive_set_error(&self->archive->archive, ENOMEM,
"Can't allocate data for lzop decompression");
self->code = ARCHIVE_FILTER_RPM;
self->name = "rpm";
- rpm = (struct rpm *)calloc(sizeof(*rpm), 1);
+ rpm = (struct rpm *)calloc(1, sizeof(*rpm));
if (rpm == NULL) {
archive_set_error(&self->archive->archive, ENOMEM,
"Can't allocate data for rpm");
self->code = ARCHIVE_FILTER_UU;
self->name = "uu";
- uudecode = (struct uudecode *)calloc(sizeof(*uudecode), 1);
+ uudecode = (struct uudecode *)calloc(1, sizeof(*uudecode));
out_buff = malloc(OUT_BUFF_SIZE);
in_buff = malloc(IN_BUFF_SIZE);
if (uudecode == NULL || out_buff == NULL || in_buff == NULL) {
struct private_data *state;
int ret;
- state = (struct private_data *)calloc(sizeof(*state), 1);
+ state = (struct private_data *)calloc(1, sizeof(*state));
out_block = (unsigned char *)malloc(out_block_size);
if (state == NULL || out_block == NULL) {
archive_set_error(&self->archive->archive, ENOMEM,
self->code = ARCHIVE_FILTER_ZSTD;
self->name = "zstd";
- state = (struct private_data *)calloc(sizeof(*state), 1);
+ state = (struct private_data *)calloc(1, sizeof(*state));
out_block = (unsigned char *)malloc(out_block_size);
dstream = ZSTD_createDStream();
archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
"archive_read_support_format_rar");
- rar = (struct rar *)calloc(sizeof(*rar), 1);
+ rar = (struct rar *)calloc(1, sizeof(*rar));
if (rar == NULL)
{
archive_set_error(&a->archive, ENOMEM, "Can't allocate rar data");
/* Initialize a block of nulls for padding purposes. */
a->null_length = 1024;
- nulls = (unsigned char *)calloc(1, a->null_length);
+ nulls = (unsigned char *)calloc(a->null_length, sizeof(unsigned char));
if (nulls == NULL) {
free(a);
return (NULL);
mydata->fd = open(mydata->filename, O_RDONLY | O_BINARY);
if (mydata->fd >= 0)
{
- if ((mydata->buffer = (void*)calloc(1, BLOCK_SIZE)) == NULL)
+ if ((mydata->buffer = (void*)calloc(BLOCK_SIZE, 1)) == NULL)
return (ARCHIVE_FAILED);
}
}
return;
}
assert((mydata->filename =
- (char *)calloc(1, strlen(filename) + 1)) != NULL);
+ (char *)calloc(strlen(filename) + 1, sizeof(char))) != NULL);
if (mydata->filename == NULL) {
free(mydata);
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
srand((unsigned int)time(NULL));
size = sizeof(strings) / sizeof(char *);
- assert((test_strings = (char **)calloc(1, sizeof(strings))) != NULL);
+ assert((test_strings = (char **)calloc(size, sizeof(char *))) != NULL);
for (i = 0; i < (size - 1); i++)
assert((test_strings[i] = strdup(strings[i])) != NULL);
char *buff;
int r;
- assert((buff = calloc(1, buffsize)) != NULL);
+ assert((buff = calloc(buffsize, sizeof(char))) != NULL);
if (buff == NULL)
return;
/* Save contents of inner Zip. */
innerLength = (size_t)archive_entry_size(ae);
- inner = calloc(innerLength, 1);
+ inner = calloc(innerLength, sizeof(char));
assertEqualInt(innerLength, archive_read_data(a, inner, innerLength));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assert(NULL != (buff = (char *)malloc(buffsize)));
datasize = 10000;
- assert(NULL != (data = (char *)calloc(1, datasize)));
+ assert(NULL != (data = (char *)calloc(datasize, 1)));
filecount = 10;
/*
assert(NULL != (buff = (char *)malloc(buffsize)));
datasize = 10000;
- assert(NULL != (data = (char *)calloc(1, datasize)));
+ assert(NULL != (data = (char *)calloc(datasize, 1)));
filecount = 10;
/*
assert(NULL != (buff = (char *)malloc(buffsize)));
datasize = 10000;
- assert(NULL != (data = (char *)calloc(1, datasize)));
+ assert(NULL != (data = (char *)calloc(datasize, 1)));
filecount = 10;
/*
c = *p;
}
if (actual_count) {
- actual = calloc(sizeof(char *), actual_count);
+ actual = calloc(actual_count, sizeof(char *));
if (actual == NULL) {
failure_start(pathname, line, "Can't allocate memory");
failure_finish(NULL);