diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 19:33:32 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 19:33:32 +0000 |
commit | 8bb05ac73a5b448b339ce0bc8d396c82c459b47f (patch) | |
tree | 1fdda006866bca20d41cb206767ea5241e36852f /misc-utils/getopt.c | |
parent | Adding debian version 2.39.3-11. (diff) | |
download | util-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-- | misc-utils/getopt.c | 10 |
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); } |