From dea85013f1d16893c2cce8c63c2033372dbc2070 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Tue, 8 Jan 2013 22:14:45 +0000 Subject: Use calloc() to get zeroed memory. MFC after: 1 month --- usr.bin/tail/read.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'usr.bin/tail') diff --git a/usr.bin/tail/read.c b/usr.bin/tail/read.c index 2cff3a39b1d4..79c4fa504351 100644 --- a/usr.bin/tail/read.c +++ b/usr.bin/tail/read.c @@ -143,9 +143,8 @@ lines(FILE *fp, const char *fn, off_t off) char *p, *sp; int blen, cnt, recno, wrap; - if ((llines = malloc(off * sizeof(*llines))) == NULL) - err(1, "malloc"); - bzero(llines, off * sizeof(*llines)); + if ((llines = calloc(off, sizeof(*llines))) == NULL) + err(1, "calloc"); p = sp = NULL; blen = cnt = recno = wrap = 0; rc = 0; -- cgit v1.2.3