Reacted on compiler warnings of Debian 13 Sid about calloc argument swap

This commit is contained in:
2025-09-14 10:23:47 +02:00
parent 517a8d9d4a
commit 605643d955
7 changed files with 21 additions and 21 deletions

View File

@@ -7,7 +7,7 @@
See libisofs/aaip_0_2.h
http://libburnia-project.org/wiki/AAIP
Copyright (c) 2009 - 2024 Thomas Schmitt
Copyright (c) 2009 - 2025 Thomas Schmitt
This file is part of the libisofs project; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
@@ -1851,9 +1851,9 @@ int aaip_decode_attrs(struct aaip_state **handle,
if(aaip->list_mem_used + new_mem >= memory_limit)
return(3);
aaip->list_mem_used+= new_mem;
aaip->list_names= calloc(sizeof(char *), aaip->list_size);
aaip->list_value_lengths= calloc(sizeof(size_t), aaip->list_size);
aaip->list_values= calloc(sizeof(char *), aaip->list_size);
aaip->list_names= calloc(aaip->list_size, sizeof(char *));
aaip->list_value_lengths= calloc(aaip->list_size, sizeof(size_t));
aaip->list_values= calloc(aaip->list_size, sizeof(char *));
if(aaip->list_names == NULL || aaip->list_value_lengths == NULL ||
aaip->list_values == NULL)
return(-1);

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2007 Vreixo Formoso
* Copyright (c) 2009 - 2016 Thomas Schmitt
* Copyright (c) 2009 - 2025 Thomas Schmitt
*
* This file is part of the libisofs project; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2
@@ -1212,7 +1212,7 @@ int match_hardlinks(Ecma119Image *img, Ecma119Node *dir, int flag)
if (ret < 0)
return ret;
nodes_size = node_count;
nodes = (Ecma119Node **) calloc(sizeof(Ecma119Node *), nodes_size);
nodes = (Ecma119Node **) calloc(nodes_size, sizeof(Ecma119Node *));
if (nodes == NULL)
return ISO_OUT_OF_MEM;
ret = make_node_array(img, dir, nodes, nodes_size, &node_count, 0);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009 - 2011 Thomas Schmitt
* Copyright (c) 2009 - 2025 Thomas Schmitt
*
* This file is part of the libisofs project; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2
@@ -64,7 +64,7 @@ int extf_running_new(ExternalFilterRuntime **running, int send_fd, int recv_fd,
pid_t child_pid, int flag)
{
ExternalFilterRuntime *o;
*running = o = calloc(sizeof(ExternalFilterRuntime), 1);
*running = o = calloc(1, sizeof(ExternalFilterRuntime));
if (o == NULL) {
return ISO_OUT_OF_MEM;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009 - 2011 Thomas Schmitt
* Copyright (c) 2009 - 2025 Thomas Schmitt
*
* This file is part of the libisofs project; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2
@@ -99,7 +99,7 @@ int gzip_running_new(GzipFilterRuntime **running, int flag)
{
GzipFilterRuntime *o;
*running = o = calloc(sizeof(GzipFilterRuntime), 1);
*running = o = calloc(1, sizeof(GzipFilterRuntime));
if (o == NULL) {
return ISO_OUT_OF_MEM;
}
@@ -674,11 +674,11 @@ int gzip_filter_get_filter(FilterContext *filter, IsoStream *original,
return ISO_NULL_POINTER;
}
str = calloc(sizeof(IsoStream), 1);
str = calloc(1, sizeof(IsoStream));
if (str == NULL) {
return ISO_OUT_OF_MEM;
}
data = calloc(sizeof(GzipFilterStreamData), 1);
data = calloc(1, sizeof(GzipFilterStreamData));
if (data == NULL) {
free(str);
return ISO_OUT_OF_MEM;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2009 - 2020 Thomas Schmitt
* Copyright (c) 2009 - 2025 Thomas Schmitt
*
* This file is part of the libisofs project; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2
@@ -217,7 +217,7 @@ int ziso_running_new(ZisofsFilterRuntime **running, off_t orig_size,
int flag)
{
ZisofsFilterRuntime *o;
*running = o = calloc(sizeof(ZisofsFilterRuntime), 1);
*running = o = calloc(1, sizeof(ZisofsFilterRuntime));
if (o == NULL) {
return ISO_OUT_OF_MEM;
}
@@ -1381,15 +1381,15 @@ int ziso_filter_get_filter(FilterContext *filter, IsoStream *original,
return ISO_NULL_POINTER;
}
str = calloc(sizeof(IsoStream), 1);
str = calloc(1, sizeof(IsoStream));
if (str == NULL) {
return ISO_OUT_OF_MEM;
}
if (flag & 2) {
unstd = calloc(sizeof(ZisofsUncomprStreamData), 1);
unstd = calloc(1, sizeof(ZisofsUncomprStreamData));
data = (ZisofsFilterStreamData *) unstd;
} else {
cnstd = calloc(sizeof(ZisofsComprStreamData), 1);
cnstd = calloc(1, sizeof(ZisofsComprStreamData));
data = (ZisofsFilterStreamData *) cnstd;
}
if (data == NULL) {

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2007 Vreixo Formoso
* Copyright (c) 2011-2024 Thomas Schmitt
* Copyright (c) 2011-2025 Thomas Schmitt
*
* This file is part of the libisofs project; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2
@@ -115,7 +115,7 @@ int create_node(Ecma119Image *t, IsoNode *iso, Iso1999Node **node)
}
n->info.dir->children = NULL;
if (dir->nchildren > 0) {
n->info.dir->children = calloc(sizeof(void*), dir->nchildren);
n->info.dir->children = calloc(dir->nchildren, sizeof(void*));
if (n->info.dir->children == NULL) {
free(n->info.dir);
free(n);

View File

@@ -1,7 +1,7 @@
/*
* Copyright (c) 2007 Vreixo Formoso
* Copyright (c) 2007 Mario Danic
* Copyright (c) 2011-2018 Thomas Schmitt
* Copyright (c) 2011-2025 Thomas Schmitt
*
* This file is part of the libisofs project; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2
@@ -160,7 +160,7 @@ int create_node(Ecma119Image *t, IsoNode *iso, JolietNode **node)
}
joliet->info.dir->children = NULL;
if (dir->nchildren > 0) {
joliet->info.dir->children = calloc(sizeof(void*), dir->nchildren);
joliet->info.dir->children = calloc(dir->nchildren, sizeof(void*));
if (joliet->info.dir->children == NULL) {
free(joliet->info.dir);
free(joliet);