Skip to content

Commit

Permalink
Merge pull request #3270 from BsAtHome/fix_calloc-transposed-args
Browse files Browse the repository at this point in the history
  • Loading branch information
andypugh authored Jan 11, 2025
2 parents 4747e59 + b033b02 commit 8a7bfea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/hal/user_comps/xhc-hb04.cc
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ static void quit(int sig)
static int hal_pin_simu(char *pin_name, void **ptr, int s)
{
printf("Creating pin: %s\n", pin_name);
*ptr = calloc(s, 1);
*ptr = calloc(1, s);
return 0;
}

Expand Down Expand Up @@ -585,7 +585,7 @@ static void hal_setup()
}
}
else {
xhc.hal = (xhc_hal_t *)calloc(sizeof(xhc_hal_t), 1);
xhc.hal = (xhc_hal_t *)calloc(1, sizeof(xhc_hal_t));
}

r = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/libnml/os_intf/_shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ shm_t *rcs_shm_open(key_t key, size_t size, int oflag, /* int mode */ ...)
shmflg |= IPC_CREAT;
}

shm = (shm_t *) calloc(sizeof(shm_t), 1);
shm = (shm_t *) calloc(1, sizeof(shm_t));
if (NULL == shm) {
rcs_print_error("rcs_shm_open: calloc failed\n");
return NULL;
Expand Down

0 comments on commit 8a7bfea

Please sign in to comment.