calendarspec: add upper bound on year
Stop looking for matches after MAX_YEAR so impossible dates like "*-02-30" and "*-04-31" don't cause an infinite loop.
This commit is contained in:
@@ -190,6 +190,7 @@ int main(int argc, char* argv[]) {
|
||||
test_next("2015-11-13 09:11:23.42/1.77", "EET", 1447398683420000, 1447398685190000);
|
||||
test_next("2015-11-13 09:11:23.42/1.77", "EET", 1447398683419999, 1447398683420000);
|
||||
test_next("Sun 16:00:00", "CET", 1456041600123456, 1456066800000000);
|
||||
test_next("*-04-31", "", 12345, -1);
|
||||
|
||||
assert_se(calendar_spec_from_string("test", &c) < 0);
|
||||
assert_se(calendar_spec_from_string("", &c) < 0);
|
||||
|
||||
Reference in New Issue
Block a user