From 2756ca4347cbda05b16954cd7f445c216b935e76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Tue, 16 Sep 2014 20:56:57 +0200 Subject: use REALLOC_ARRAY for changing the allocation size of arrays Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- column.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'column.c') diff --git a/column.c b/column.c index 76b615db5f..8082a944fd 100644 --- a/column.c +++ b/column.c @@ -81,8 +81,7 @@ static void compute_column_width(struct column_data *data) */ static void shrink_columns(struct column_data *data) { - data->width = xrealloc(data->width, - sizeof(*data->width) * data->cols); + REALLOC_ARRAY(data->width, data->cols); while (data->rows > 1) { int x, total_width, cols, rows; rows = data->rows; @@ -91,8 +90,7 @@ static void shrink_columns(struct column_data *data) data->rows--; data->cols = DIV_ROUND_UP(data->list->nr, data->rows); if (data->cols != cols) - data->width = xrealloc(data->width, - sizeof(*data->width) * data->cols); + REALLOC_ARRAY(data->width, data->cols); compute_column_width(data); total_width = strlen(data->opts.indent); -- cgit v1.2.3