summaryrefslogtreecommitdiffstats
path: root/text-utils/column.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/column.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 'text-utils/column.c')
-rw-r--r--text-utils/column.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/text-utils/column.c b/text-utils/column.c
index 0f2e7e1..06aeaa0 100644
--- a/text-utils/column.c
+++ b/text-utils/column.c
@@ -585,7 +585,7 @@ static void add_entry(struct column_control *ctl, size_t *maxents, wchar_t *wcs)
{
if (ctl->nents <= *maxents) {
*maxents += 1000;
- ctl->ents = xrealloc(ctl->ents, *maxents * sizeof(wchar_t *));
+ ctl->ents = xreallocarray(ctl->ents, *maxents, sizeof(wchar_t *));
}
ctl->ents[ctl->nents] = wcs;
ctl->nents++;
@@ -662,6 +662,8 @@ static int read_input(struct column_control *ctl, FILE *fp)
}
} while (rc == 0);
+ free(buf);
+
return rc;
}
@@ -776,8 +778,8 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(USAGE_SEPARATOR, out);
- printf(USAGE_HELP_OPTIONS(34));
- printf(USAGE_MAN_TAIL("column(1)"));
+ fprintf(out, USAGE_HELP_OPTIONS(34));
+ fprintf(out, USAGE_MAN_TAIL("column(1)"));
exit(EXIT_SUCCESS);
}