From 068e5caf0c5382f6e099dc91f402889494920b91 Mon Sep 17 00:00:00 2001 From: pfg Date: Sun, 10 Jul 2016 02:46:20 +0000 Subject: [PATCH] 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) --- usr.bin/mail/cmd3.c | 4 ++-- usr.bin/mail/vars.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/mail/cmd3.c b/usr.bin/mail/cmd3.c index 9308ad3024b..38808e2f74e 100644 --- a/usr.bin/mail/cmd3.c +++ b/usr.bin/mail/cmd3.c @@ -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; diff --git a/usr.bin/mail/vars.c b/usr.bin/mail/vars.c index dca0604796f..8cfc06eacd3 100644 --- a/usr.bin/mail/vars.c +++ b/usr.bin/mail/vars.c @@ -56,7 +56,7 @@ assign(const char *name, const char *value) 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; -- 2.11.4.GIT