Re: cal: drop obsolete parsemonth return value checks

Jeremie Courreges-Anglas <[email protected]>
Newsgroups gmane.os.openbsd.tech
Message-ID <[email protected]>
On Thu, Jun 25, 2026 at 09:09:58AM +0000, Johannes Thyssen Tishman wrote:
> These became redundant since month range checks were implemented in
> parsemonth in revision 1.15.

ok jca@

> Index: cal.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/cal/cal.c,v
> diff -u -p -r1.32 cal.c
> --- cal.c	18 Aug 2024 19:58:35 -0000	1.32
> +++ cal.c	25 Jun 2026 09:09:04 -0000
> @@ -194,14 +194,10 @@ main(int argc, char *argv[])
>  	switch(argc) {
>  	case 2:
>  		month = parsemonth(*argv++);
> -		if (!month)
> -			errx(1, "Unable to parse month");
>  		/* FALLTHROUGH */
>  	case 1:
>  		if (argc == 1 && !isdigit((unsigned char)*argv[0])) {
>  			month = parsemonth(*argv);
> -			if (!month)
> -				errx(1, "illegal year value: use 1-9999");
>  			(void)time(&now);
>  			local_time = localtime(&now);
>  			year = local_time->tm_year + 1900;
> 

-- 
jca
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.