X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Frender.c;h=7aa80a6977e69abd92f328429627c22a021e7260;hb=e5a05f16e98783e2785107059de22a44f51c18ea;hp=b88f10badb7a69779df99ce132dfc31c2a2ee5fa;hpb=8f7af0acaf8a9253242d89fcdb26e285841f7833;p=pspp diff --git a/src/output/render.c b/src/output/render.c index b88f10badb..7aa80a6977 100644 --- a/src/output/render.c +++ b/src/output/render.c @@ -539,9 +539,8 @@ render_page_allocate__ (const struct render_params *params, for (int i = 0; i < TABLE_N_AXES; i++) { - page->cp[i] = xmalloc ((2 * n[i] + 2) * sizeof *page->cp[i]); - page->join_crossing[i] = xzalloc ((n[i] + 1) - * sizeof *page->join_crossing[i]); + page->cp[i] = xcalloc ((2 * n[i] + 2) , sizeof *page->cp[i]); + page->join_crossing[i] = xcalloc ((n[i] + 1) , sizeof *page->join_crossing[i]); } hmap_init (&page->overflows); @@ -732,7 +731,7 @@ render_page_create (const struct render_params *params, struct table *table, span multiple columns. */ struct render_row *columns[2]; for (int i = 0; i < 2; i++) - columns[i] = xzalloc (nc * sizeof *columns[i]); + columns[i] = xcalloc (nc , sizeof *columns[i]); for (int y = 0; y < nr; y++) for (int x = 0; x < nc;) { @@ -816,7 +815,7 @@ render_page_create (const struct render_params *params, struct table *table, } /* Calculate heights of cells that do not span multiple rows. */ - struct render_row *rows = xzalloc (nr * sizeof *rows); + struct render_row *rows = XCALLOC (nr, struct render_row); for (int y = 0; y < nr; y++) for (int x = 0; x < nc;) {