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:
parent
15aa38690e
commit
955bf4dc04
|
@ -818,7 +818,7 @@ main(int argc, char *argv[])
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
tagslen = strlen(optarg) + 2;
|
tagslen = strlen(optarg) + 2;
|
||||||
tags = calloc(tagslen, 1);
|
tags = calloc(1, tagslen);
|
||||||
if (tags == NULL) {
|
if (tags == NULL) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"error: cannot allocate memory "
|
"error: cannot allocate memory "
|
||||||
|
|
|
@ -181,7 +181,7 @@ write_map(const char *filename, nvlist_t *allcfgs)
|
||||||
* no locking, it only guarantees the packed nvlist on disk
|
* no locking, it only guarantees the packed nvlist on disk
|
||||||
* is updated atomically and is internally consistent.
|
* is updated atomically and is internally consistent.
|
||||||
*/
|
*/
|
||||||
char *tmpname = calloc(MAXPATHLEN, 1);
|
char *tmpname = calloc(1, MAXPATHLEN);
|
||||||
if (tmpname == NULL) {
|
if (tmpname == NULL) {
|
||||||
free(buf);
|
free(buf);
|
||||||
return (ENOMEM);
|
return (ENOMEM);
|
||||||
|
|
Loading…
Reference in New Issue