mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 09:20:25 +00:00
lib: fix calloc warning on recent compiler
Fix the following compiler warning: ``` lib/elf_py.c: In function _elffile_load_: lib/elf_py.c:1310:34: warning: _calloc_ sizes specified with _sizeof_ in the earlier argument and not in the later argument [-Wcalloc-transposed-args] 1310 | w->sects = calloc(sizeof(PyObject *), w->ehdr->e_shnum); | ^~~~~~~~ lib/elf_py.c:1310:34: note: earlier argument should specify number of elements, later size of each element ``` Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
8b1b5315c3
commit
660146b57a
@ -1307,7 +1307,7 @@ static PyObject *elffile_load(PyTypeObject *type, PyObject *args,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
w->sects = calloc(sizeof(PyObject *), w->ehdr->e_shnum);
|
w->sects = calloc(w->ehdr->e_shnum, sizeof(PyObject *));
|
||||||
w->n_sect = w->ehdr->e_shnum;
|
w->n_sect = w->ehdr->e_shnum;
|
||||||
|
|
||||||
return (PyObject *)w;
|
return (PyObject *)w;
|
||||||
|
Loading…
Reference in New Issue
Block a user