From c61e14d3a8412cd50d98aab604e607692c844c8a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 14 Apr 2024 21:33:30 +0200 Subject: Adding upstream version 2.40. Signed-off-by: Daniel Baumann --- text-utils/col.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'text-utils/col.c') diff --git a/text-utils/col.c b/text-utils/col.c index 56ccec9..f9bc3be 100644 --- a/text-utils/col.c +++ b/text-utils/col.c @@ -182,10 +182,10 @@ static void __attribute__((__noreturn__)) usage(void) " -x, --spaces convert tabs to spaces\n" " -l, --lines NUM buffer at least NUM lines\n" )); - printf( " -H, --help %s\n", USAGE_OPTSTR_HELP); - printf( " -V, --version %s\n", USAGE_OPTSTR_VERSION); + fprintf(out, " -H, --help %s\n", USAGE_OPTSTR_HELP); + fprintf(out, " -V, --version %s\n", USAGE_OPTSTR_VERSION); - printf(USAGE_MAN_TAIL("col(1)")); + fprintf(out, USAGE_MAN_TAIL("col(1)")); exit(EXIT_SUCCESS); } @@ -244,11 +244,11 @@ static void flush_line(struct col_ctl *ctl, struct col_line *l) */ if (sorted_size < l->l_lsize) { sorted_size = l->l_lsize; - sorted = xrealloc(sorted, sizeof(struct col_char) * sorted_size); + sorted = xreallocarray(sorted, sorted_size, sizeof(struct col_char)); } if (count_size <= l->l_max_col) { count_size = l->l_max_col + 1; - count = xrealloc(count, sizeof(size_t) * count_size); + count = xreallocarray(count, count_size, sizeof(size_t)); } memset(count, 0, sizeof(size_t) * l->l_max_col + 1); for (i = nchars, c = l->l_line; c && 0 < i; i--, c++) -- cgit v1.2.3