Skip to content

Commit

Permalink
Fix timer event weekday check.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjko committed Dec 23, 2023
1 parent 8835c21 commit 95e0fcd
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,15 +312,12 @@ int check_timer_event(const struct timer_event *e, const datetime_t *t)
if (!e || !t)
return 0;


if (e->minute >= 0 && e->minute != t->min)
return 0;
if (e->hour >= 0 && e->hour != t->hour)
return 0;
if (e->wday) {
if (e->wday & ((1 << t->dotw) == 0))
if (e->wday > 0 && !(e->wday & ((1 << t->dotw))))
return 0;
}

return 1;
}
Expand Down

0 comments on commit 95e0fcd

Please sign in to comment.