Reacted on compiler warnings of Debian 13 Sid about calloc argument swap
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
|
||||
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
|
||||
|
||||
Copyright 2007-2020 Thomas Schmitt, <scdbackup@gmx.net>
|
||||
Copyright 2007-2025 Thomas Schmitt, <scdbackup@gmx.net>
|
||||
|
||||
Provided under GPL version 2 or later.
|
||||
|
||||
@@ -60,12 +60,12 @@ int Xorriso_extf_new(struct XorrisO *xorriso, struct Xorriso_extF **filter,
|
||||
struct Xorriso_extF *o= NULL;
|
||||
IsoExternalFilterCommand *cmd;
|
||||
|
||||
*filter= o= calloc(sizeof(struct Xorriso_extF), 1);
|
||||
*filter= o= calloc(1, sizeof(struct Xorriso_extF));
|
||||
if(o == NULL)
|
||||
goto failure;
|
||||
o->flag= flag;
|
||||
o->cmd= NULL;
|
||||
o->cmd= cmd= calloc(sizeof(IsoExternalFilterCommand), 1);
|
||||
o->cmd= cmd= calloc(1, sizeof(IsoExternalFilterCommand));
|
||||
if(cmd == NULL)
|
||||
goto failure;
|
||||
cmd->version= 0;
|
||||
@@ -83,7 +83,7 @@ int Xorriso_extf_new(struct XorrisO *xorriso, struct Xorriso_extF **filter,
|
||||
cmd->path= strdup(path);
|
||||
if(cmd->path == NULL)
|
||||
goto failure;
|
||||
cmd->argv= calloc(sizeof(char *), argc + 2);
|
||||
cmd->argv= calloc(argc + 2, sizeof(char *));
|
||||
if(cmd->argv == NULL)
|
||||
goto failure;
|
||||
for(i= 0; i < argc + 2; i++)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
|
||||
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
|
||||
|
||||
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
|
||||
Copyright 2007-2025 Thomas Schmitt, <scdbackup@gmx.net>
|
||||
|
||||
Provided under GPL version 2 or later.
|
||||
|
||||
@@ -891,8 +891,8 @@ int Findjob_set_num_filter(struct FindjoB *o, int test_type,
|
||||
|
||||
t= o->cursor->test;
|
||||
t->test_type= test_type;
|
||||
t->arg1= calloc(sizeof(int), 1);
|
||||
t->arg2= calloc(sizeof(int), 1);
|
||||
t->arg1= calloc(1, sizeof(int));
|
||||
t->arg2= calloc(1, sizeof(int));
|
||||
if(t->arg1 == NULL || t->arg2 == NULL)
|
||||
return(-1);
|
||||
*((int *) t->arg1)= num1;
|
||||
@@ -913,8 +913,8 @@ int Findjob_set_size_filter(struct FindjoB *o, int test_type,
|
||||
|
||||
t= o->cursor->test;
|
||||
t->test_type= test_type;
|
||||
t->arg1= calloc(sizeof(off_t), 1);
|
||||
t->arg2= calloc(sizeof(int), 1);
|
||||
t->arg1= calloc(1, sizeof(off_t));
|
||||
t->arg2= calloc(1, sizeof(int));
|
||||
if(t->arg1 == NULL || t->arg2 == NULL)
|
||||
return(-1);
|
||||
*((off_t *) t->arg1)= num1;
|
||||
@@ -935,8 +935,8 @@ int Findjob_set_off_t_filter(struct FindjoB *o, int test_type,
|
||||
|
||||
t= o->cursor->test;
|
||||
t->test_type= test_type;
|
||||
t->arg1= calloc(sizeof(off_t), 1);
|
||||
t->arg2= calloc(sizeof(off_t), 1);
|
||||
t->arg1= calloc(1, sizeof(off_t));
|
||||
t->arg2= calloc(1, sizeof(off_t));
|
||||
if(t->arg1 == NULL || t->arg2 == NULL)
|
||||
return(-1);
|
||||
*((off_t *) t->arg1)= num1;
|
||||
@@ -971,7 +971,7 @@ int Findjob_set_test_hidden(struct FindjoB *o, int mode, int flag)
|
||||
|
||||
t= o->cursor->test;
|
||||
t->test_type= 17;
|
||||
t->arg1= calloc(sizeof(int), 1);
|
||||
t->arg1= calloc(1, sizeof(int));
|
||||
if(t->arg1 == NULL)
|
||||
return(-1);
|
||||
*((int *) t->arg1)= mode;
|
||||
@@ -1110,7 +1110,7 @@ int Findjob_set_uint64_filter(struct FindjoB *o, int test_type, uint64_t value,
|
||||
|
||||
t= o->cursor->test;
|
||||
t->test_type= test_type;
|
||||
t->arg1= calloc(sizeof(uint64_t), 1);
|
||||
t->arg1= calloc(1, sizeof(uint64_t));
|
||||
*((uint64_t *) t->arg1)= value;
|
||||
return(1);
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
|
||||
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
|
||||
|
||||
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
|
||||
Copyright 2007-2025 Thomas Schmitt, <scdbackup@gmx.net>
|
||||
|
||||
Provided under GPL version 2 or later.
|
||||
|
||||
@@ -354,7 +354,7 @@ int Xorriso_sorted_node_array(struct XorrisO *xorriso,
|
||||
if(ret<=0)
|
||||
return(ret);
|
||||
|
||||
*node_array= calloc(sizeof(IsoNode *), (*nodec)+1);
|
||||
*node_array= calloc((*nodec) + 1, sizeof(IsoNode *));
|
||||
if(*node_array==NULL) {
|
||||
sprintf(xorriso->info_text,
|
||||
"Cannot allocate memory for %d directory entries", *nodec);
|
||||
|
@@ -1 +1 @@
|
||||
#define Xorriso_timestamP "2025.06.24.171249"
|
||||
#define Xorriso_timestamP "2025.09.14.085312"
|
||||
|
Reference in New Issue
Block a user