staticlibs / ccronexpr

Cron expression parsing in ANSI C
Apache License 2.0
150 stars 78 forks source link

cron_prev 29-feb infinite loop #32

Closed JJM1987 closed 1 year ago

JJM1987 commented 3 years ago

cron_prev function infinite loop on 29 February. Issue occurs in non leap years.

Example infinite loop: Expression: " 29 2 " Current time: 2021-12-7 12:00:00

Example correct result: Expression: " 29 2 " Current time: 2020-12-7 12:00:00

staticlibs commented 3 years ago

Thanks for the report! This is a nasty bug, will try to fix it.

alenloncaric commented 3 years ago

Hi,

was this bug ever fixed?

Thank you!

BR

ghseb commented 3 years ago

@alenloncaric Just tried adding check_next("* * * 29 2 *", "2021-12-07_12:00:00", "2024-02-29_00:00:00"); to the tests and it seems to work as expected (at lease on my toolchain with minor local changes).

Probably it makes sense to check it yourself.

exander77 commented 1 year ago

@ghseb He complains about cron_prev and not cron_next.

exander77 commented 1 year ago

This is the same bug as: https://github.com/staticlibs/ccronexpr/issues/35

staticlibs commented 1 year ago

This project is no longer maintained, see its updated and extended fork in exander77/supertinycron repo, closing the issue to archive the repo.