summaryrefslogtreecommitdiffstats
path: root/misc-utils/getopt.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 19:33:30 +0000
commitc61e14d3a8412cd50d98aab604e607692c844c8a (patch)
tree4925aca0e6b64c8664ea2f3fdfa99a52dc93d5da /misc-utils/getopt.c
parentAdding upstream version 2.39.3. (diff)
downloadutil-linux-c61e14d3a8412cd50d98aab604e607692c844c8a.tar.xz
util-linux-c61e14d3a8412cd50d98aab604e607692c844c8a.zip
Adding upstream version 2.40.upstream/2.40
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--misc-utils/getopt.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/misc-utils/getopt.c b/misc-utils/getopt.c
index 977b725..f989461 100644
--- a/misc-utils/getopt.c
+++ b/misc-utils/getopt.c
@@ -256,9 +256,9 @@ static void add_longopt(struct getopt_control *ctl, const char *name, int has_ar
if (ctl->long_options_nr == ctl->long_options_length) {
ctl->long_options_length += REALLOC_INCREMENT;
- ctl->long_options = xrealloc(ctl->long_options,
- sizeof(struct option) *
- ctl->long_options_length);
+ ctl->long_options = xreallocarray(ctl->long_options,
+ ctl->long_options_length,
+ sizeof(struct option));
}
if (name) {
/* Not for init! */
@@ -359,8 +359,8 @@ static void __attribute__((__noreturn__)) usage(void)
fputs(_(" -T, --test test for getopt(1) version\n"), stdout);
fputs(_(" -u, --unquoted do not quote the output\n"), stdout);
fputs(USAGE_SEPARATOR, stdout);
- printf(USAGE_HELP_OPTIONS(31));
- printf(USAGE_MAN_TAIL("getopt(1)"));
+ fprintf(stdout, USAGE_HELP_OPTIONS(31));
+ fprintf(stdout, USAGE_MAN_TAIL("getopt(1)"));
exit(EXIT_SUCCESS);
}