summaryrefslogtreecommitdiffstats
path: root/text-utils/col.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:32 +0000
commit8bb05ac73a5b448b339ce0bc8d396c82c459b47f (patch)
tree1fdda006866bca20d41cb206767ea5241e36852f /text-utils/col.c
parentAdding debian version 2.39.3-11. (diff)
downloadutil-linux-8bb05ac73a5b448b339ce0bc8d396c82c459b47f.tar.xz
util-linux-8bb05ac73a5b448b339ce0bc8d396c82c459b47f.zip
Merging upstream version 2.40.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-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++)