Fix trivial calloc(3) arguments order

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
This commit is contained in:
Tomohiro Kusumi 2022-02-03 04:27:35 +09:00 committed by GitHub
parent 15aa38690e
commit 955bf4dc04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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 "

View File

@ -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);