From db4177c9e2852b9c52ec57573e84680427603166 Mon Sep 17 00:00:00 2001 From: tedu Date: Wed, 7 May 2014 01:27:42 +0000 Subject: [PATCH] calloc, from peter malone --- usr.bin/pkill/pkill.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.bin/pkill/pkill.c b/usr.bin/pkill/pkill.c index de908d79a84..df349bb0980 100644 --- a/usr.bin/pkill/pkill.c +++ b/usr.bin/pkill/pkill.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pkill.c,v 1.34 2013/11/12 13:54:51 deraadt Exp $ */ +/* $OpenBSD: pkill.c,v 1.35 2014/05/07 01:27:42 tedu Exp $ */ /* $NetBSD: pkill.c,v 1.5 2002/10/27 11:49:34 kleink Exp $ */ /*- @@ -277,9 +277,8 @@ main(int argc, char **argv) * Allocate memory which will be used to keep track of the * selection. */ - if ((selected = malloc(nproc)) == NULL) + if ((selected = calloc(nproc, 1)) == NULL) errx(STATUS_ERROR, "memory allocation failure"); - memset(selected, 0, nproc); /* * Refine the selection. -- 2.20.1