summaryrefslogtreecommitdiffstats
path: root/text-utils/col.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:34 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:34 +0000
commit1272be04be0cb803eec87f602edb2e3e6f111aea (patch)
treebce17f6478cdd9f3c4ec3d751135dc42786d6a56 /text-utils/col.c
parentReleasing progress-linux version 2.39.3-11~progress7.99u1. (diff)
downloadutil-linux-1272be04be0cb803eec87f602edb2e3e6f111aea.tar.xz
util-linux-1272be04be0cb803eec87f602edb2e3e6f111aea.zip
Merging upstream version 2.40.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'text-utils/col.c')
-rw-r--r--text-utils/col.c10
1 files changed, 5 insertions, 5 deletions
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++)