Skip to content

Commit abc4141

Browse files
authored
Merge pull request #78 from nobu/civil-month-range
Check month range as civil
2 parents bd148c6 + 7459cc6 commit abc4141

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ext/date/date_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ c_valid_civil_p(int y, int m, int d, double sg,
761761

762762
if (m < 0)
763763
m += 13;
764+
if (m < 1 || m > 12)
765+
return 0;
764766
if (d < 0) {
765767
if (!c_find_ldom(y, m, sg, rjd, ns))
766768
return 0;

0 commit comments

Comments
 (0)