Skip to content

Commit

Permalink
fix calloc argument order
Browse files Browse the repository at this point in the history
These were found through gcc warnings.

Message-ID: <[email protected]>
  • Loading branch information
Shugyousha authored and leahneukirchen committed May 18, 2024
1 parent a4502e8 commit d5e202b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mflag.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ main(int argc, char *argv[])
return 0;
}

args = calloc(sizeof (char *), argsalloc);
args = calloc(argsalloc, sizeof (char *));
if (!args)
exit(-1);

Expand Down
2 changes: 1 addition & 1 deletion msort.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ main(int argc, char *argv[])

xpledge("stdio rpath", "");

mails = calloc(sizeof (struct mail), mailalloc);
mails = calloc(mailalloc, sizeof (struct mail));
if (!mails)
exit(-1);

Expand Down
2 changes: 1 addition & 1 deletion mthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ sort_tree(struct container *c, int depth)
if (i == 1) // no sort needed
return;

struct container **a = calloc(sizeof (struct container *), i);
struct container **a = calloc(i, sizeof (struct container *));
if (!a)
return;

Expand Down

0 comments on commit d5e202b

Please sign in to comment.