From: tedu Date: Wed, 7 May 2014 01:27:42 +0000 (+0000) Subject: calloc, from peter malone X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=db4177c9e2852b9c52ec57573e84680427603166;p=openbsd calloc, from peter malone --- 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.