Author: delphij
Date: Tue Jan  8 22:14:45 2013
New Revision: 245184
URL: http://svnweb.freebsd.org/changeset/base/245184

Log:
  Use calloc() to get zeroed memory.
  
  MFC after:    1 month

Modified:
  head/usr.bin/tail/read.c

Modified: head/usr.bin/tail/read.c
==============================================================================
--- head/usr.bin/tail/read.c    Tue Jan  8 22:12:45 2013        (r245183)
+++ head/usr.bin/tail/read.c    Tue Jan  8 22:14:45 2013        (r245184)
@@ -143,9 +143,8 @@ lines(FILE *fp, const char *fn, off_t of
        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;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to