diff options
author | René Scharfe <l.s.r@web.de> | 2014-09-16 20:56:57 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-09-18 09:13:42 -0700 |
commit | 2756ca4347cbda05b16954cd7f445c216b935e76 (patch) | |
tree | 70afb2d44557fd05bbc0707c190c6026ab6135fd /column.c | |
parent | 3ac22f82edec108986b2627fcd6f2a8039617a23 (diff) | |
download | git-2756ca4347cbda05b16954cd7f445c216b935e76.tar.gz |
use REALLOC_ARRAY for changing the allocation size of arraysrs/realloc-array
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'column.c')
-rw-r--r-- | column.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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); |