common/list.c: fixed -Wcalloc-transposed-args GCC warning
```
/home/user/CLionProjects/xrdp/common/list.c: In function ‘list_create_sized’:
/home/user/CLionProjects/xrdp/common/list.c:50:41: error: ‘calloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
50 | self = (struct list *)calloc(sizeof(struct list), 1);
| ^~~~~~
/home/user/CLionProjects/xrdp/common/list.c:50:41: note: earlier argument should specify number of elements, later size of each element
```
This commit is contained in:
+1
-1
@@ -47,7 +47,7 @@ list_create_sized(unsigned int size)
|
||||
{
|
||||
size = DEFAULT_LIST_SIZE;
|
||||
}
|
||||
self = (struct list *)calloc(sizeof(struct list), 1);
|
||||
self = (struct list *)calloc(1, sizeof(struct list));
|
||||
if (self != NULL)
|
||||
{
|
||||
self->items = (tbus *)malloc(sizeof(tbus) * size);
|
||||
|
||||
Reference in New Issue
Block a user