diff --git a/libisofs/aaip_0_2.c b/libisofs/aaip_0_2.c index 8f91d32..f2975bc 100644 --- a/libisofs/aaip_0_2.c +++ b/libisofs/aaip_0_2.c @@ -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); diff --git a/libisofs/ecma119_tree.c b/libisofs/ecma119_tree.c index 2798d9e..4c28cb4 100644 --- a/libisofs/ecma119_tree.c +++ b/libisofs/ecma119_tree.c @@ -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); diff --git a/libisofs/filters/external.c b/libisofs/filters/external.c index 8975263..1fe2781 100644 --- a/libisofs/filters/external.c +++ b/libisofs/filters/external.c @@ -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; } diff --git a/libisofs/filters/gzip.c b/libisofs/filters/gzip.c index c30df0e..4af2c5e 100644 --- a/libisofs/filters/gzip.c +++ b/libisofs/filters/gzip.c @@ -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; diff --git a/libisofs/filters/zisofs.c b/libisofs/filters/zisofs.c index 454be35..54c110d 100644 --- a/libisofs/filters/zisofs.c +++ b/libisofs/filters/zisofs.c @@ -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) { diff --git a/libisofs/iso1999.c b/libisofs/iso1999.c index 3decd42..5ca94c3 100644 --- a/libisofs/iso1999.c +++ b/libisofs/iso1999.c @@ -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); diff --git a/libisofs/joliet.c b/libisofs/joliet.c index 47375b8..d4620ac 100644 --- a/libisofs/joliet.c +++ b/libisofs/joliet.c @@ -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);