From b4fa75b9ac5160dae40c4763ba87927762d4e75f Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 7 Mar 2013 23:28:23 +0100 Subject: Wrapping and rendering fixes --- src/wrap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/wrap.c') diff --git a/src/wrap.c b/src/wrap.c index 5ecee08..10c225d 100644 --- a/src/wrap.c +++ b/src/wrap.c @@ -468,7 +468,7 @@ static void output(int a, int i, int *p, struct frame *fr, l->max_boxes = s-q; alloc_boxes(l); - for ( j=q+1; j<=s; j++ ) { + for ( j=q; jboxes[l->n_boxes++] = boxes->boxes[j]; } @@ -528,13 +528,13 @@ static void knuth_suboptimal_fit(struct wrap_line *boxes, double line_length, } if ( reject ) return; - p = malloc(boxes->n_boxes*sizeof(int)); + p = calloc(boxes->n_boxes, sizeof(int)); if ( p == NULL ) { fprintf(stderr, "Failed to allocate p_k\n"); return; } - s = malloc(boxes->n_boxes*sizeof(double)); + s = calloc(boxes->n_boxes, sizeof(double)); if ( s == NULL ) { fprintf(stderr, "Failed to allocate s_k\n"); return; -- cgit v1.2.3