This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCHv3 1/3] Refactor tst-strtod-round.c


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]