=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/grid.c,v retrieving revision 1.40 retrieving revision 1.41 diff -c -r1.40 -r1.41 *** src/usr.bin/tmux/grid.c 2014/10/08 17:14:04 1.40 --- src/usr.bin/tmux/grid.c 2014/10/08 17:35:58 1.41 *************** *** 1,4 **** ! /* $OpenBSD: grid.c,v 1.40 2014/10/08 17:14:04 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: grid.c,v 1.41 2014/10/08 17:35:58 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott *************** *** 172,178 **** u_int yy; yy = gd->hsize + gd->sy; ! gd->linedata = xrealloc(gd->linedata, yy + 1, sizeof *gd->linedata); memset(&gd->linedata[yy], 0, sizeof gd->linedata[yy]); gd->hsize++; --- 172,179 ---- u_int yy; yy = gd->hsize + gd->sy; ! gd->linedata = xreallocarray(gd->linedata, yy + 1, ! sizeof *gd->linedata); memset(&gd->linedata[yy], 0, sizeof gd->linedata[yy]); gd->hsize++; *************** *** 187,193 **** /* Create a space for a new line. */ yy = gd->hsize + gd->sy; ! gd->linedata = xrealloc(gd->linedata, yy + 1, sizeof *gd->linedata); /* Move the entire screen down to free a space for this line. */ gl_history = &gd->linedata[gd->hsize]; --- 188,195 ---- /* Create a space for a new line. */ yy = gd->hsize + gd->sy; ! gd->linedata = xreallocarray(gd->linedata, yy + 1, ! sizeof *gd->linedata); /* Move the entire screen down to free a space for this line. */ gl_history = &gd->linedata[gd->hsize]; *************** *** 221,227 **** if (sx <= gl->cellsize) return; ! gl->celldata = xrealloc(gl->celldata, sx, sizeof *gl->celldata); for (xx = gl->cellsize; xx < sx; xx++) grid_put_cell(gd, xx, py, &grid_default_cell); gl->cellsize = sx; --- 223,229 ---- if (sx <= gl->cellsize) return; ! gl->celldata = xreallocarray(gl->celldata, sx, sizeof *gl->celldata); for (xx = gl->cellsize; xx < sx; xx++) grid_put_cell(gd, xx, py, &grid_default_cell); gl->cellsize = sx; *************** *** 610,616 **** } while (len < off + size + codelen + 1) { ! buf = xrealloc(buf, 2, len); len *= 2; } --- 612,618 ---- } while (len < off + size + codelen + 1) { ! buf = xreallocarray(buf, 2, len); len *= 2; } *************** *** 685,691 **** nx = ox + to_copy; /* Resize the destination line. */ ! dst_gl->celldata = xrealloc(dst_gl->celldata, nx, sizeof *dst_gl->celldata); dst_gl->cellsize = nx; --- 687,693 ---- nx = ox + to_copy; /* Resize the destination line. */ ! dst_gl->celldata = xreallocarray(dst_gl->celldata, nx, sizeof *dst_gl->celldata); dst_gl->cellsize = nx; *************** *** 724,730 **** to_copy = src_gl->cellsize; /* Expand destination line. */ ! dst_gl->celldata = xrealloc(NULL, to_copy, sizeof *dst_gl->celldata); dst_gl->cellsize = to_copy; dst_gl->flags |= GRID_LINE_WRAPPED; --- 726,732 ---- to_copy = src_gl->cellsize; /* Expand destination line. */ ! dst_gl->celldata = xreallocarray(NULL, to_copy, sizeof *dst_gl->celldata); dst_gl->cellsize = to_copy; dst_gl->flags |= GRID_LINE_WRAPPED;