diff --git a/src/cron/c/parse.c b/src/cron/c/parse.c index 1ac23c0..097a08d 100644 --- a/src/cron/c/parse.c +++ b/src/cron/c/parse.c @@ -218,6 +218,7 @@ enum cron_parse_error ce_parse_expression(cron_expression *out, char *s) { // least one more part that follows. if (next != NULL) { res = cron_parse_too_many_parts; + goto end; } else if (s[0] != '\0') { // There's one more excessive trailing part if (part_count == max_parts) { diff --git a/src/cron/expression_test.v b/src/cron/expression_test.v index a8ec5a5..c7065f8 100644 --- a/src/cron/expression_test.v +++ b/src/cron/expression_test.v @@ -4,7 +4,6 @@ import time { parse } fn util_test_time(exp string, t1_str string, t2_str string) ! { ce := parse_expression(exp)! - dump(ce) t1 := parse(t1_str)! t2 := parse(t2_str)! diff --git a/src/cron/parse_test.v b/src/cron/parse_test.v index 692a381..eb78c19 100644 --- a/src/cron/parse_test.v +++ b/src/cron/parse_test.v @@ -16,6 +16,10 @@ fn test_not_allowed() { res = false parse_expression('0 0 30 2') or { res = true } assert res + + res = false + parse_expression('0 0 30 2 0') or { res = true } + assert res } fn test_leading_star() {