Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jul 2016 02:46:20 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r302511 - head/usr.bin/mail
Message-ID:  <201607100246.u6A2kKJo027502@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Sun Jul 10 02:46:20 2016
New Revision: 302511
URL: https://svnweb.freebsd.org/changeset/base/302511

Log:
  mail(1): Invert calloc(3) argument order.
  
  calloc(3) is documented to have first a number and then a size.
  
  Obtained from:	OpenBSD (through NetBSD)

Modified:
  head/usr.bin/mail/cmd3.c
  head/usr.bin/mail/vars.c

Modified: head/usr.bin/mail/cmd3.c
==============================================================================
--- head/usr.bin/mail/cmd3.c	Sun Jul 10 01:09:16 2016	(r302510)
+++ head/usr.bin/mail/cmd3.c	Sun Jul 10 02:46:20 2016	(r302511)
@@ -463,7 +463,7 @@ group(char **argv)
 	gname = *argv;
 	h = hash(gname);
 	if ((gh = findgroup(gname)) == NULL) {
-		gh = calloc(sizeof(*gh), 1);
+		gh = calloc(1, sizeof(*gh));
 		gh->g_name = vcopy(gname);
 		gh->g_list = NULL;
 		gh->g_link = groups[h];
@@ -477,7 +477,7 @@ group(char **argv)
 	 */
 
 	for (ap = argv+1; *ap != NULL; ap++) {
-		gp = calloc(sizeof(*gp), 1);
+		gp = calloc(1, sizeof(*gp));
 		gp->ge_name = vcopy(*ap);
 		gp->ge_link = gh->g_list;
 		gh->g_list = gp;

Modified: head/usr.bin/mail/vars.c
==============================================================================
--- head/usr.bin/mail/vars.c	Sun Jul 10 01:09:16 2016	(r302510)
+++ head/usr.bin/mail/vars.c	Sun Jul 10 02:46:20 2016	(r302511)
@@ -56,7 +56,7 @@ assign(const char *name, const char *val
 	h = hash(name);
 	vp = lookup(name);
 	if (vp == NULL) {
-		vp = calloc(sizeof(*vp), 1);
+		vp = calloc(1, sizeof(*vp));
 		vp->v_name = vcopy(name);
 		vp->v_link = variables[h];
 		variables[h] = vp;



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