aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/tail/read.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2013-01-08 22:14:45 +0000
committerXin LI <delphij@FreeBSD.org>2013-01-08 22:14:45 +0000
commitdea85013f1d16893c2cce8c63c2033372dbc2070 (patch)
tree10f5584f12141bc3de3cb9a2b02b8a97f4959cf5 /usr.bin/tail/read.c
parentf29c6bdec5bdd6f96c78e757cac0f7acbc8abace (diff)
downloadsrc-dea85013f1d16893c2cce8c63c2033372dbc2070.tar.gz
src-dea85013f1d16893c2cce8c63c2033372dbc2070.zip
Notes
Diffstat (limited to 'usr.bin/tail/read.c')
-rw-r--r--usr.bin/tail/read.c5
1 files changed, 2 insertions, 3 deletions
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;