summaryrefslogtreecommitdiffstats
path: root/misc-utils/getopt.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 /misc-utils/getopt.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 'misc-utils/getopt.c')
-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);
}