Unverified Commit 473c5cff authored by Anton Fedorov's avatar Anton Fedorov Committed by GitHub

Fix ValidateDateTime: check day instead month

Found with PVS-Studio static analyser, see 
https://www.viva64.com/en/b/0550/
parent a3868af1
......@@ -80,9 +80,9 @@ bool ValidateDateTime(const DateTime& time) {
return false;
}
if (time.month == 2 && IsLeapYear(time.year)) {
return time.month <= kDaysInMonth[time.month] + 1;
return time.day <= kDaysInMonth[time.month] + 1;
} else {
return time.month <= kDaysInMonth[time.month];
return time.day <= kDaysInMonth[time.month];
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment