use reallocarray instead of calloc; avoid the zero before infill

ok nicm
pull/1/head
deraadt 2015-04-23 07:45:50 +00:00
parent 9a453dd354
commit ab73997cc5
1 changed files with 1 additions and 1 deletions

2
grid.c
View File

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