From 471ad77d543812b40bdf783a753971288015bded Mon Sep 17 00:00:00 2001 From: deraadt Date: Thu, 23 Apr 2015 07:45:50 +0000 Subject: [PATCH] use reallocarray instead of calloc; avoid the zero before infill ok nicm --- usr.bin/tmux/grid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.20.1