X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Foutput%2Fpivot-table.c;h=f1e0e73372177d1ed566c690523f7b0e1b7bf0dc;hb=2ba9563cb1fddad9430be0c415dc81456f006281;hp=6bb446ed8ea5bb2895274a8907e58c88e5caf367;hpb=a79baa2f1a1c77bb9e4c6ff92f0b15e7c361a665;p=pspp diff --git a/src/output/pivot-table.c b/src/output/pivot-table.c index 6bb446ed8e..f1e0e73372 100644 --- a/src/output/pivot-table.c +++ b/src/output/pivot-table.c @@ -968,7 +968,7 @@ clone_category (struct pivot_category *old, .extra_depth = old->extra_depth, .subs = (old->n_subs - ? xzalloc (old->n_subs * sizeof *new->subs) + ? xcalloc (old->n_subs, sizeof *new->subs) : NULL), .n_subs = old->n_subs, .allocated_subs = old->n_subs, @@ -1006,9 +1006,9 @@ clone_dimension (struct pivot_dimension *old, struct pivot_table *new_pt) .axis_type = old->axis_type, .level = old->level, .top_index = old->top_index, - .data_leaves = xzalloc (old->n_leaves * sizeof *new->data_leaves), - .presentation_leaves = xzalloc (old->n_leaves - * sizeof *new->presentation_leaves), + .data_leaves = xcalloc (old->n_leaves , sizeof *new->data_leaves), + .presentation_leaves = xcalloc (old->n_leaves + , sizeof *new->presentation_leaves), .n_leaves = old->n_leaves, .allocated_leaves = old->n_leaves, .hide_all_labels = old->hide_all_labels,