mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-09-13 21:37:43 +02:00
- Fix alloc-size and calloc-transposed-args compiler warnings.
This commit is contained in:
+3
-3
@@ -220,7 +220,7 @@ perfsetup(struct perfinfo* info)
|
||||
#endif
|
||||
signal(SIGTERM, perf_sigh) == SIG_ERR)
|
||||
fatal_exit("could not bind to signal");
|
||||
info->io = (struct perfio*)calloc(sizeof(struct perfio), info->io_num);
|
||||
info->io = (struct perfio*)calloc(info->io_num, sizeof(struct perfio));
|
||||
if(!info->io) fatal_exit("out of memory");
|
||||
#ifndef S_SPLINT_S
|
||||
FD_ZERO(&info->rset);
|
||||
@@ -501,8 +501,8 @@ qlist_grow_capacity(struct perfinfo* info)
|
||||
{
|
||||
size_t newcap = (size_t)((info->qlist_capacity==0)?16:
|
||||
info->qlist_capacity*2);
|
||||
uint8_t** d = (uint8_t**)calloc(sizeof(uint8_t*), newcap);
|
||||
size_t* l = (size_t*)calloc(sizeof(size_t), newcap);
|
||||
uint8_t** d = (uint8_t**)calloc(newcap, sizeof(uint8_t*));
|
||||
size_t* l = (size_t*)calloc(newcap, sizeof(size_t));
|
||||
if(!d || !l) fatal_exit("out of memory");
|
||||
if(info->qlist_data && info->qlist_capacity)
|
||||
memcpy(d, info->qlist_data, sizeof(uint8_t*)*
|
||||
|
||||
@@ -502,7 +502,7 @@ struct listen_port* daemon_remote_open_ports(struct config_file*
|
||||
|
||||
struct daemon_remote* daemon_remote_create(struct config_file* ATTR_UNUSED(cfg))
|
||||
{
|
||||
return (struct daemon_remote*)calloc(1,1);
|
||||
return (struct daemon_remote*)calloc(1, sizeof(struct daemon_remote));
|
||||
}
|
||||
|
||||
void daemon_remote_delete(struct daemon_remote* rc)
|
||||
|
||||
Reference in New Issue
Block a user