On 13 February 2014 17:39, Todd C. Miller <todd.mil...@courtesan.com> wrote:
> Correct, though I prefer the following for clarity.
>
>  - todd
>
> Index: lib/libc/time/strptime.c
> ===================================================================
> RCS file: /home/cvs/openbsd/src/lib/libc/time/strptime.c,v
> retrieving revision 1.15
> diff -u -r1.15 strptime.c
> --- lib/libc/time/strptime.c    16 Jan 2012 17:42:45 -0000      1.15
> +++ lib/libc/time/strptime.c    13 Feb 2014 22:37:16 -0000
> @@ -594,7 +594,7 @@
>                 const int year = tm->tm_year + TM_YEAR_BASE;
>                 const int *mon_lens = mon_lengths[isleap(year)];
>                 if (!(fields & FIELD_TM_YDAY) &&
> -                   (fields & (FIELD_TM_MON|FIELD_TM_MDAY))) {
> +                   (fields & FIELD_TM_MON) && (fields & FIELD_TM_MDAY)) {
>                         tm->tm_yday = tm->tm_mday - 1;
>                         for (i = 0; i < tm->tm_mon; i++)
>                                 tm->tm_yday += mon_lens[i];
>

I like this version much better.

.... Ken

Reply via email to