Skip to content

Commit

Permalink
fix calloc-transposed-args warning
Browse files Browse the repository at this point in the history
  • Loading branch information
q66 committed Dec 9, 2024
1 parent 2b7cd20 commit 9232499
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions patches/src.freebsd.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4962,6 +4962,15 @@
const char *digestname;
size_t digestnamelen;
size_t hashstrlen;
@@ -593,7 +600,7 @@
while (argc--)
gnu_check(*argv++);
argc = 0;
- argv = calloc(sizeof(char *), numrecs + 1);
+ argv = calloc(numrecs + 1, sizeof(char *));
for (rec = head; rec != NULL; rec = rec->next) {
argv[argc] = rec->filename;
argc++;
@@ -687,7 +694,7 @@
DIGEST_CTX context;
char *end, *p, *q;
Expand Down
2 changes: 1 addition & 1 deletion src.freebsd/coreutils/md5/md5.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ main(int argc, char *argv[])
while (argc--)
gnu_check(*argv++);
argc = 0;
argv = calloc(sizeof(char *), numrecs + 1);
argv = calloc(numrecs + 1, sizeof(char *));
for (rec = head; rec != NULL; rec = rec->next) {
argv[argc] = rec->filename;
argc++;
Expand Down

0 comments on commit 9232499

Please sign in to comment.