summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-09-01 19:32:20 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-09-01 19:32:20 +0000
commitb32111f8c12acc73d36d7ce64b0eb6e316f54762 (patch)
tree19db006283ebbbae6eab5322cd14d17a659b2356 /usr.bin
parent8b2d7ba1f3b200ac03db469f8f4535c1103aeb03 (diff)
malloc(n * m) -> calloc(n, m); from zinovik
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/systat/swap.c6
-rw-r--r--usr.bin/systat/vmstat.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/systat/swap.c b/usr.bin/systat/swap.c
index 619a6d21721..84e55190b2b 100644
--- a/usr.bin/systat/swap.c
+++ b/usr.bin/systat/swap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: swap.c,v 1.19 2007/02/25 18:21:24 deraadt Exp $ */
+/* $OpenBSD: swap.c,v 1.20 2007/09/01 19:32:19 deraadt Exp $ */
/* $NetBSD: swap.c,v 1.9 1998/12/26 07:05:08 marc Exp $ */
/*-
@@ -35,7 +35,7 @@
#if 0
static char sccsid[] = "@(#)swap.c 8.3 (Berkeley) 4/29/95";
#endif
-static char rcsid[] = "$OpenBSD: swap.c,v 1.19 2007/02/25 18:21:24 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: swap.c,v 1.20 2007/09/01 19:32:19 deraadt Exp $";
#endif /* not lint */
#include <sys/cdefs.h>
@@ -98,7 +98,7 @@ fetchswap(void)
if (swap_devices)
(void)free(swap_devices);
- swap_devices = (struct swapent *)malloc(nswap * sizeof(*swap_devices));
+ swap_devices = (struct swapent *)calloc(nswap, sizeof(*swap_devices));
if (swap_devices == NULL)
/* XXX */ ; /* XXX systat doesn't do errors! */
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index bb33c675698..c79b7c7f5ac 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmstat.c,v 1.62 2007/02/25 18:21:24 deraadt Exp $ */
+/* $OpenBSD: vmstat.c,v 1.63 2007/09/01 19:32:19 deraadt Exp $ */
/* $NetBSD: vmstat.c,v 1.5 1996/05/10 23:16:40 thorpej Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94";
#endif
-static char rcsid[] = "$OpenBSD: vmstat.c,v 1.62 2007/02/25 18:21:24 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: vmstat.c,v 1.63 2007/09/01 19:32:19 deraadt Exp $";
#endif /* not lint */
/*
@@ -604,7 +604,7 @@ static void
allocinfo(struct Info *s)
{
- s->intrcnt = (u_quad_t *) malloc(nintr * sizeof(u_quad_t));
+ s->intrcnt = (u_quad_t *) calloc(nintr, sizeof(u_quad_t));
if (s->intrcnt == NULL)
errx(2, "out of memory");
}