mirror of
https://github.com/avrdudes/avrdude.git
synced 2026-09-29 20:38:44 +03:00
Fix -Wcalloc-transposed-args warning
The calloc(3) function has two arguments: the number of members, and the size of one member. sizeof(...) makes more sense as member size, and 1 as number of members. At least that is what the gcc warning wants. This was the only compiler warning I could get on my Fedora 40 test build (gcc 14) with CFLAGS="-Wall -Wextra -Werror".
This commit is contained in:
@@ -1271,7 +1271,7 @@ avrftdi_setup(PROGRAMMER * pgm)
|
||||
avrftdi_t* pdata;
|
||||
|
||||
|
||||
if(!(pgm->cookie = calloc(sizeof(avrftdi_t), 1))) {
|
||||
if(!(pgm->cookie = calloc(1, sizeof(avrftdi_t)))) {
|
||||
log_err("Error allocating memory.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user