Re: [PATCH] primes(6) -- remove unnecessary code

From: Steve Kargl <sgk_at_troutmask.apl.washington.edu>
Date: Fri, 27 Dec 2019 10:07:49 -0800
On Fri, Dec 27, 2019 at 09:55:10AM -0800, Steve Kargl wrote:
> This patch removes an unnecessary check as
> the condition can never occur.
> 
> Index: primes.c
> ===================================================================
> --- primes.c	(revision 355983)
> +++ primes.c	(working copy)
> _at__at_ -129,7 +129,7 _at__at_
>  	switch (argc) {
>  	case 2:
>  		/* Start and stop supplied on the command line. */
> -		if (argv[0][0] == '-' || argv[1][0] == '-')
> +		if (argv[1][0] == '-')
>  			errx(1, "negative numbers aren't permitted.");
>  
>  		errno = 0;

Hmm, I withdraw the patch.  One can get a negative start 
value, but one would need to force that condition via
a subversion via getopt.

-- 
Steve
Received on Fri Dec 27 2019 - 17:07:52 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:22 UTC