From: deraadt Date: Thu, 23 Apr 2015 07:45:50 +0000 (+0000) Subject: use reallocarray instead of calloc; avoid the zero before infill X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=471ad77d543812b40bdf783a753971288015bded;p=openbsd use reallocarray instead of calloc; avoid the zero before infill ok nicm --- diff --git a/usr.bin/tmux/grid.c b/usr.bin/tmux/grid.c index 9d750a14dba..0e2850d2e60 100644 --- a/usr.bin/tmux/grid.c +++ b/usr.bin/tmux/grid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grid.c,v 1.41 2014/10/08 17:35:58 nicm Exp $ */ +/* $OpenBSD: grid.c,v 1.42 2015/04/23 07:45:50 deraadt Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -657,7 +657,7 @@ grid_duplicate_lines(struct grid *dst, u_int dy, struct grid *src, u_int sy, memcpy(dstl, srcl, sizeof *dstl); if (srcl->cellsize != 0) { - dstl->celldata = xcalloc( + dstl->celldata = xreallocarray(NULL, srcl->cellsize, sizeof *dstl->celldata); memcpy(dstl->celldata, srcl->celldata, srcl->cellsize * sizeof *dstl->celldata);