diff options
Diffstat (limited to 'misc-utils/getopt.c')
-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); } |