Use calloc() to get zeroed memory.

MFC after:	1 month
This commit is contained in:
Xin LI 2013-01-08 22:14:45 +00:00
parent f29c6bdec5
commit dea85013f1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=245184

View File

@ -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;