Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Sep 2016 11:20:59 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r305805 - head/usr.sbin/autofs
Message-ID:  <201609141120.u8EBKx1A083885@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Wed Sep 14 11:20:58 2016
New Revision: 305805
URL: https://svnweb.freebsd.org/changeset/base/305805

Log:
  Use proper argument order for calloc(3).
  
  MFC after:	1 month

Modified:
  head/usr.sbin/autofs/automountd.c
  head/usr.sbin/autofs/autounmountd.c
  head/usr.sbin/autofs/defined.c

Modified: head/usr.sbin/autofs/automountd.c
==============================================================================
--- head/usr.sbin/autofs/automountd.c	Wed Sep 14 11:16:00 2016	(r305804)
+++ head/usr.sbin/autofs/automountd.c	Wed Sep 14 11:20:58 2016	(r305805)
@@ -97,7 +97,7 @@ pick_option(const char *option, char **o
 
 	tofree = *optionsp;
 
-	newoptions = calloc(strlen(*optionsp) + 1, 1);
+	newoptions = calloc(1, strlen(*optionsp) + 1);
 	if (newoptions == NULL)
 		log_err(1, "calloc");
 

Modified: head/usr.sbin/autofs/autounmountd.c
==============================================================================
--- head/usr.sbin/autofs/autounmountd.c	Wed Sep 14 11:16:00 2016	(r305804)
+++ head/usr.sbin/autofs/autounmountd.c	Wed Sep 14 11:20:58 2016	(r305805)
@@ -78,7 +78,7 @@ automounted_add(fsid_t fsid, const char 
 {
 	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);

Modified: head/usr.sbin/autofs/defined.c
==============================================================================
--- head/usr.sbin/autofs/defined.c	Wed Sep 14 11:16:00 2016	(r305804)
+++ head/usr.sbin/autofs/defined.c	Wed Sep 14 11:20:58 2016	(r305805)
@@ -225,7 +225,7 @@ defined_add(const char *name, const char
 
 	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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609141120.u8EBKx1A083885>