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:
firewave
2025-11-03 14:57:43 +01:00
parent b4cf498144
commit 6b816d0c64
+1 -1
View File
@@ -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);