This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCHv3 1/3] Refactor tst-strtod-round.c
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "Paul E. Murphy" <murphyp at linux dot vnet dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Tue, 24 May 2016 15:12:34 +0000
- Subject: Re: [PATCHv3 1/3] Refactor tst-strtod-round.c
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1464041464 dot git dot murphyp at linux dot vnet dot ibm dot com> <bc4fe14cc1086e590ea4f86f6e1522a38f29f53b dot 1464041464 dot git dot murphyp at linux dot vnet dot ibm dot com>
On Mon, 23 May 2016, Paul E. Murphy wrote:
> + char *fin_name = argv[1];
> + char *fout_name = argv[2];
> +
> + if (argc < 3)
> + {
> + fprintf (stderr, "Usage: %s [input] [output]\n", basename (argv[0]));
> + return EXIT_FAILURE;
> + }
The check for argc < 3 should take place before you access argv[1] and
argv[2] (if no arguments are passed, argv[2] doesn't exist). And you
shouldn't have [] around "input" and "output" in the message since that
suggests they are optional, which they aren't (cf. gen-auto-libm-tests
using <>).
OK with those changes.
--
Joseph S. Myers
joseph@codesourcery.com