pivot-table: Don't rely on xcalloc (0, x) returning nonnull.
[pspp] / src / output / pivot-table.c
index b185d3ea8ac4c9ff8440cb5bc4561ed096f47a7c..c255ea83b0b6a4880f26c9abb854f66b9a859d96 100644 (file)
@@ -370,7 +370,8 @@ pivot_axis_iterator_next (size_t *indexes, const struct pivot_axis *axis)
           if (axis->dimensions[i]->n_leaves == 0)
             return NULL;
 
-      return xcalloc (axis->n_dimensions, sizeof *indexes);
+      size_t size = axis->n_dimensions * sizeof *indexes;
+      return xzalloc (MAX (size, 1));
     }
 
   for (size_t i = 0; i < axis->n_dimensions; i++)