From 275253770b5fa20590ddb84babe7ba48b2844712 Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Wed, 14 Sep 2016 11:20:58 +0000 Subject: [PATCH] Use proper argument order for calloc(3). MFC after: 1 month --- usr.sbin/autofs/automountd.c | 2 +- usr.sbin/autofs/autounmountd.c | 2 +- usr.sbin/autofs/defined.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/autofs/automountd.c b/usr.sbin/autofs/automountd.c index 44eda6922dd..2983eead99e 100644 --- a/usr.sbin/autofs/automountd.c +++ b/usr.sbin/autofs/automountd.c @@ -97,7 +97,7 @@ pick_option(const char *option, char **optionsp) tofree = *optionsp; - newoptions = calloc(strlen(*optionsp) + 1, 1); + newoptions = calloc(1, strlen(*optionsp) + 1); if (newoptions == NULL) log_err(1, "calloc"); diff --git a/usr.sbin/autofs/autounmountd.c b/usr.sbin/autofs/autounmountd.c index e64736b1884..3a13225aa80 100644 --- a/usr.sbin/autofs/autounmountd.c +++ b/usr.sbin/autofs/autounmountd.c @@ -78,7 +78,7 @@ automounted_add(fsid_t fsid, const char *mountpoint) { struct automounted_fs *af; - af = calloc(sizeof(*af), 1); + af = calloc(1, sizeof(*af)); if (af == NULL) log_err(1, "calloc"); af->af_mount_time = time(NULL); diff --git a/usr.sbin/autofs/defined.c b/usr.sbin/autofs/defined.c index f94b92d0de9..9bb285f3c29 100644 --- a/usr.sbin/autofs/defined.c +++ b/usr.sbin/autofs/defined.c @@ -225,7 +225,7 @@ defined_add(const char *name, const char *value) log_debugx("defining variable %s=%s", name, value); - d = calloc(sizeof(*d), 1); + d = calloc(1, sizeof(*d)); if (d == NULL) log_err(1, "calloc"); d->d_name = checked_strdup(name);