Skip to content

Commit

Permalink
Fix trivial calloc(3) arguments order
Browse files Browse the repository at this point in the history
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <freqlabs@FreeBSD.org>
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@gmail.com>
Closes #13052
  • Loading branch information
kusumi authored Feb 2, 2022
1 parent 15aa386 commit 955bf4d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/zpool_influxdb/zpool_influxdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ main(int argc, char *argv[])
break;
case 't':
tagslen = strlen(optarg) + 2;
tags = calloc(tagslen, 1);
tags = calloc(1, tagslen);
if (tags == NULL) {
fprintf(stderr,
"error: cannot allocate memory "
Expand Down
2 changes: 1 addition & 1 deletion tests/zfs-tests/cmd/draid/draid.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ write_map(const char *filename, nvlist_t *allcfgs)
* no locking, it only guarantees the packed nvlist on disk
* is updated atomically and is internally consistent.
*/
char *tmpname = calloc(MAXPATHLEN, 1);
char *tmpname = calloc(1, MAXPATHLEN);
if (tmpname == NULL) {
free(buf);
return (ENOMEM);
Expand Down

0 comments on commit 955bf4d

Please sign in to comment.