aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wrap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wrap.c b/src/wrap.c
index 658d201..8ba0245 100644
--- a/src/wrap.c
+++ b/src/wrap.c
@@ -528,13 +528,13 @@ static void knuth_suboptimal_fit(struct wrap_line *boxes, double line_length,
}
if ( reject ) return;
- p = calloc(boxes->n_boxes, sizeof(int));
+ p = malloc(boxes->n_boxes * sizeof(int));
if ( p == NULL ) {
fprintf(stderr, "Failed to allocate p_k\n");
return;
}
- s = calloc(boxes->n_boxes, sizeof(double));
+ s = malloc(boxes->n_boxes * sizeof(double));
if ( s == NULL ) {
fprintf(stderr, "Failed to allocate s_k\n");
return;