1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/date] Check month range as civil

This commit is contained in:
Nobuyoshi Nakada 2022-10-27 14:12:27 +09:00 committed by git
parent cb80ee7a4a
commit 739ad81ff1

View file

@ -761,6 +761,8 @@ c_valid_civil_p(int y, int m, int d, double sg,
if (m < 0) if (m < 0)
m += 13; m += 13;
if (m < 1 || m > 12)
return 0;
if (d < 0) { if (d < 0) {
if (!c_find_ldom(y, m, sg, rjd, ns)) if (!c_find_ldom(y, m, sg, rjd, ns))
return 0; return 0;